# Complete - m-openai-workspace-agent-execution-contract/03+02_cli_agent_cwd

## 완료 일시

2026-06-13

## 요약

CLI agent cwd 적용 작업을 2회 리뷰 루프로 검증했고 최종 판정은 PASS다.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_local_G07_0.log` | `code_review_local_G07_0.log` | FAIL | codex app-server/opencode owned server cwd 테스트와 repo 내부 edge-node 진단 증거가 누락되어 follow-up으로 전환 |
| `plan_local_G07_1.log` | `code_review_local_G07_1.log` | PASS | provider server cwd tests, opencode `--dir` 우선순위 테스트, repo 내부 edge-node 진단 증거가 보완됨 |

## 구현/정리 내용

- `ExecutionSpec.Workspace`를 one-shot/codex-exec 공통 command, persistent non-terminal, terminal session, codex app-server, opencode owned server process cwd로 적용했다.
- opencode owned server는 explicit `--dir`가 있으면 workspace보다 우선하도록 유지했다.
- one-shot, persistent non-terminal, terminal, codex app-server, opencode owned server workspace cwd 회귀 테스트를 추가했다.
- repo 내부 `scripts/dev/edge.sh` + `scripts/dev/node.sh` 진단 transcript로 메시지 2회와 command 응답을 확인했다.

## 최종 검증

- `go test -count=1 ./apps/node/internal/terminal ./apps/node/internal/adapters/cli` - PASS; `ok iop/apps/node/internal/terminal 0.552s`, `ok iop/apps/node/internal/adapters/cli 45.995s`
- `./scripts/e2e-smoke.sh` - PASS; `[e2e] Auxiliary smoke test PASSED.`
- `go test -list 'Cwd|OpencodeLocalServerCwd|CodexAppServerProcCwd' ./apps/node/internal/adapters/cli ./apps/node/internal/terminal` - PASS; cwd test names include one-shot, persistent non-terminal, persistent terminal, codex app-server, opencode workspace, opencode dir override, and terminal session.
- `git diff --check` - PASS
- `scripts/dev/edge.sh` + `scripts/dev/node.sh` repo 내부 edge-node 진단 - PASS; transcript evidence in `code_review_local_G07_1.log` covers `/nodes`, two foreground messages, `/capabilities`, `/transport`, `/sessions`, and `/terminate-session`.

## Roadmap Completion

- Milestone: `agent-roadmap/phase/automation-runtime-bridge/milestones/openai-workspace-agent-execution-contract.md`
- Completed task ids:
  - `agent-cwd`: PASS; evidence=`agent-task/archive/2026/06/m-openai-workspace-agent-execution-contract/03+02_cli_agent_cwd/plan_local_G07_0.log`, `agent-task/archive/2026/06/m-openai-workspace-agent-execution-contract/03+02_cli_agent_cwd/code_review_local_G07_0.log`, `agent-task/archive/2026/06/m-openai-workspace-agent-execution-contract/03+02_cli_agent_cwd/plan_local_G07_1.log`, `agent-task/archive/2026/06/m-openai-workspace-agent-execution-contract/03+02_cli_agent_cwd/code_review_local_G07_1.log`; verification=`go test -count=1 ./apps/node/internal/terminal ./apps/node/internal/adapters/cli`, `./scripts/e2e-smoke.sh`, `scripts/dev/edge.sh + scripts/dev/node.sh`
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
