# Milestone: Codex App Server 스트리밍 전환 ## 위치 - Roadmap: `agent-roadmap/ROADMAP.md` - Phase: `agent-roadmap/phase/automation-runtime-bridge/PHASE.md` ## 목표 Codex CLI adapter의 기본 `codex` target/profile을 `codex app-server` 기반 실행 경로로 전환한다. `codex exec --json`의 최종 메시지 중심 출력 대신 app-server의 `item/agentMessage/delta`를 IOP `delta` event로 전달해 사용자 레벨에서 실시간 스트림 UX를 제공한다. ## 상태 [완료] ## 구현 잠금 - 상태: 해제 - 결정 필요: 없음 ## 범위 - CLI adapter에 `codex-app-server` 실행 mode 추가 - `codex app-server --stdio` JSON-RPC client lifecycle 구현 - IOP logical `session_id`와 app-server thread 재사용 매핑 - app-server `item/agentMessage/delta`, `item/completed`, `turn/completed`, error event를 IOP runtime event로 변환 - 기본 target/profile 이름은 `codex`로 유지하고, app-server mode를 `codex`의 기본 실행 경로로 전환 - `codex-exec` 경로는 fallback 또는 별도 명시 profile로 남길 수 있게 호환성 유지 - `scripts/dev/edge.sh`와 `scripts/dev/node.sh` 기준 2-message 사용자 레벨 stream smoke 검증 ## 기능 ### Epic: [appserver-runtime] Codex app-server runtime Codex app-server를 장기 JSON-RPC 실행기로 붙여 IOP CLI adapter의 세션/스트림 계약에 맞춘다. - [x] [mode-router] CLI adapter에 `codex-app-server` mode를 추가하고 executor/session reporter 라우팅을 분리한다. - [x] [rpc-lifecycle] `codex app-server --stdio` 프로세스를 시작한 뒤 `initialize`, `initialized`, `thread/start`, `turn/start` 흐름을 안정적으로 처리한다. - [x] [session-thread] IOP `session_id`별 app-server thread를 재사용하고 `/terminate-session`에서 해당 세션을 정리한다. - [x] [event-map] `item/agentMessage/delta`를 `RuntimeEvent{Type: delta}`로 전달하고, `turn/completed`는 complete, app-server error와 failed turn은 error로 매핑한다. - [x] [default-profile] `configs/edge.yaml`의 기본 `codex` profile을 app-server mode로 전환한다. 검증: `console.target`과 CLI profile key가 모두 `codex`인 상태에서 기본 Codex 실행이 app-server 경로를 사용한다. - [x] [exec-fallback] 기존 `codex-exec` 실행 경로는 회귀 테스트와 fallback profile 후보로 유지한다. - [x] [stream-smoke] `./scripts/dev/edge.sh`와 `./scripts/dev/node.sh` 시작 후 `codex` target으로 2-message 왕복에서 델타 스트림이 관찰된다. 검증: 두 메시지가 같은 logical session에서 완료되고, 적어도 한 turn에서 app-server delta event가 IOP delta로 relay된다. ## 완료 리뷰 - 상태: 승인됨 - 요청일: 2026-06-12 - 완료 근거: - `01_appserver_rpc_client`, `02+01_session_events`, `03+02_default_profile`, `04+03_stream_smoke`의 `complete.log`가 모두 Roadmap Completion을 포함하며, 기능 Task id 7개가 모두 PASS로 매칭되었다. - 실제 `codex` profile smoke에서 foreground 2회, background 1회, `mode=codex-app-server` session list, `/terminate-session`, `/status`가 통과했다. - 최종 검증은 `go test ./apps/node/... ./apps/edge/... -count=1`, `./scripts/e2e-smoke.sh`, `IOP_E2E_PROFILE=codex IOP_E2E_RUN_TIMEOUT=120 IOP_E2E_STATUS_TIMEOUT=120 ./scripts/e2e-smoke.sh`로 확인되었다. - 리뷰 필요: - [x] 사용자가 완료 결과를 확인했다 - [x] archive 이동을 승인했다 - 리뷰 코멘트: 2026-06-13 사용자 요청으로 완료 승인 및 archive 이동을 수행했다. ## 범위 제외 - Codex app-server의 전체 rich client 기능 구현 - WebSocket transport 우선 도입 - OpenAI-compatible API 또는 A2A payload에 Codex app-server 제어 기능을 노출 - app-server approval UI의 전체 제품화 - `codex exec --json` 삭제 ## 작업 컨텍스트 - 관련 경로: `apps/node/internal/adapters/cli/`, `apps/node/internal/runtime/`, `configs/edge.yaml`, `scripts/dev/edge.sh`, `scripts/dev/node.sh`, `agent-test/local/` - 표준선(선택): 사용자가 원하는 기본 target/profile 이름은 `codex`다. app-server mode는 새 target 이름이 아니라 기존 `codex` profile의 기본 실행 방식으로 들어간다. - 선행 작업: `codex exec --json` 델타 미지원 확인, `codex app-server`의 ChatGPT Plus 인증 및 2-turn delta stream probe 확인 - 후속 작업: app-server approval, rate-limit/account 상태, rich client 기능을 별도 운영 표면으로 확장할지 검토 - 확인 필요: 없음