Skip to content

First-class Codex engine via codex exec --json (structured), not raw stdout capture #729

Description

@serge-ivo

Depends on #728 (structured engine adapters).

Problem

Codex sessions run through runOneShot() in packages/browser-runner/src/coding/headless.ts with mode = "raw": we spawn codex exec --sandbox danger-full-access "<turn>" and capture stdout raw. Consequences, all structural:

Codex supports structured output

codex exec (the non-interactive form we already invoke — no TTY, no tmux) supports --json, which streams a JSONL event feed on stdout: thread/turn/item events including agent messages, reasoning, command executions, and token usage on turn completion. This is the direct analogue of Claude's --output-format stream-json. (--output-last-message <file> is also available for just the final message.)

Proposed fix

Implement a Codex adapter on the #728 abstraction:

Acceptance

Refs: #728, #556, #594, #545, #674

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: correctnessReal defect, no live harm today — inert fields, miscounts, missing guardscoderThe Coder wedge agent (#68) — Engine, Pilot, Co-pilot, Loop, OverseerenhancementNew feature or requestrunnerpackages/browser-runner + packages/cli — ships only via an npm publish

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions