Skip to content

feat(codex): Codex agent-provider payload v2 — app-server on capability seams, vault-only auth#2757

Merged
gavrielc merged 1 commit into
providersfrom
providers-codex-v2
Jun 14, 2026
Merged

feat(codex): Codex agent-provider payload v2 — app-server on capability seams, vault-only auth#2757
gavrielc merged 1 commit into
providersfrom
providers-codex-v2

Conversation

@omri-maya

Copy link
Copy Markdown
Collaborator

What this does

Replaces the old Codex payload with v2: Codex as a full agent provider on the host's capability seams, authenticated vault-only through OneCLI. This branch carries only the Codex-specific files; the OpenCode payload on this branch is untouched.

Surface area

Hostsrc/providers/codex.ts, src/providers/codex-agents-md.ts (+ tests): seam registration, AGENTS.md composition from the DB row, per-group ~/.codex mount, vault-only auth stub.

Containercontainer/agent-runner/src/providers/codex.ts, codex-app-server.ts, exchange-archive.ts (+ turns/factory/dockerfile tests): app-server transport, turn lifecycle, provider-owned exchange archiving.

Imagecontainer/Dockerfile: ARG CODEX_VERSION=0.138.0 + pinned global install, covered by a structural codex-dockerfile.test.ts.

Setup modulesetup/providers/codex.ts (+ tests): the registry entry the setup picker consumes.

Notable fixes

  • Clear the active turn on completion so racing follow-ups aren't dropped.
  • Pre-create the auth-stub mountpoint (macOS Docker can't create a missing file mountpoint inside a virtiofs dir mount → exit 125 on first spawn).

Removed

  • /add-codex SKILL.md — trunk is its canonical home.
  • A stale host-contribution assertion for authored-skills hydration not present in this payload.

Testing

Host Codex suite 5/5; container Codex logic green; image builds clean with the pin (codex-cli 0.138.0 at /pnpm/codex); live agent validated end-to-end on a clean VM.

…ty seams, vault-only auth

Rewrite the Codex provider onto the host's capability seams. Codex runs as a
real agent provider via `codex app-server` — planning, MCP tools, server-side
history, session resume — not as an MCP tool under Claude.

- Host provider (src/providers/codex.ts, codex-agents-md.ts): registers on the
  provider-container seam, composes AGENTS.md from the real config row, mounts a
  per-group ~/.codex state dir, vault-only auth stub (no credential in-container).
- Container runtime (codex.ts, codex-app-server.ts): app-server transport, turn
  lifecycle, racing-follow-up fix (clear the active turn on completion).
- Provider-owned per-exchange archiving (exchange-archive.ts) via onExchangeComplete.
- Codex CLI pinned to 0.138.0 in the Dockerfile (ARG + global install), guarded
  by a structural dockerfile test.
- macOS first-spawn fix: pre-create the auth-stub mountpoint.

The /add-codex skill is dropped from this branch — trunk is its canonical home.
The authored-skills canonical store is deferred to a future provider-seam PR
(its stale host-contribution assertion is removed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@gavrielc gavrielc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants