Provider: OpenAI Codex implementation behind the AgentProvider interface #2

Closed
opened 2026-07-05 22:39:07 +02:00 by dominik.polakovics · 4 comments

Context

The MVP implements the AgentProvider seam (spawn / auth / attach / workspace seeding / model catalogs) with a single implementation: Claude Code (docs/agent-brief.md, decision D14). Sessions and repos already carry a provider column. This issue adds Codex as the second provider.

Scope

  • Spawn: build the Codex CLI argv for an interactive session in a worktree; wire model/effort catalog equivalents.
  • Auth: Codex login flow (device/OAuth) surfaced in the lab UI, status check analogous to claude auth status.
  • Attach: decide the interaction story — Codex has no claude.ai remote-control deep-link analog, so this likely depends on the embedded remote interface roadmap item (terminal/chat in lab's own UI) or Codex's own web session linking if available by then. Decide before implementation; this is the open design question.
  • Workspace seeding: AGENTS.md / Codex config instead of CLAUDE.local.md + .claude/settings.local.json; skills-equivalent guidance; incogni attribution measures mapped to Codex behavior (verify what attribution Codex writes into commits/PRs).
  • Seed prompt: reuse the tracker-agnostic labctl vocabulary unchanged.

Acceptance

  • A repo can set provider: codex (default stays claude-code) and run manual + AFK sessions end to end.
  • The incogni guarantees (pre-push guard, no attribution, neutral branches) hold identically under Codex.
  • No provider-specific code outside the provider package (grep-clean for codex/claude references in core).
## Context The MVP implements the `AgentProvider` seam (spawn / auth / attach / workspace seeding / model catalogs) with a single implementation: Claude Code (`docs/agent-brief.md`, decision D14). Sessions and repos already carry a `provider` column. This issue adds Codex as the second provider. ## Scope - **Spawn**: build the Codex CLI argv for an interactive session in a worktree; wire model/effort catalog equivalents. - **Auth**: Codex login flow (device/OAuth) surfaced in the lab UI, status check analogous to `claude auth status`. - **Attach**: decide the interaction story — Codex has no claude.ai remote-control deep-link analog, so this likely depends on the embedded remote interface roadmap item (terminal/chat in lab's own UI) or Codex's own web session linking if available by then. Decide before implementation; this is the open design question. - **Workspace seeding**: `AGENTS.md` / Codex config instead of `CLAUDE.local.md` + `.claude/settings.local.json`; skills-equivalent guidance; incogni attribution measures mapped to Codex behavior (verify what attribution Codex writes into commits/PRs). - **Seed prompt**: reuse the tracker-agnostic `labctl` vocabulary unchanged. ## Acceptance - A repo can set `provider: codex` (default stays claude-code) and run manual + AFK sessions end to end. - The incogni guarantees (pre-push guard, no attribution, neutral branches) hold identically under Codex. - No provider-specific code outside the provider package (grep-clean for codex/claude references in core).
Author
Owner

This was generated by AI during triage.

Triage Notes

What we've established so far:

  • The attach design question is resolved. OpenAI's remote-connections feature cannot attach a headless Codex CLI session on a Linux server: it requires the Codex desktop App (macOS/Windows) as the connection host, pairing is a QR-code flow started from the App ("you can't set it up from the Codex CLI or IDE Extension"), and no per-session URL exists to capture (https://developers.openai.com/codex/remote-connections). There is no claude.ai-style deep-link analog to wait for.
  • Decision: ship local-attach, don't block on the embedded remote interface. A Codex session gets no web Open link. Manual sessions are driven via tmux attach on the lab host; the instance row shows a copyable attach command. AFK sessions are unaffected (the seed prompt travels in the spawn argv). The embedded remote interface remains the later UX upgrade and is not a dependency.
  • Decision: deep-link capture becomes an optional provider capability (a DeepLinker interface following the ConnectingReporter pattern), with the open-affordance fallback moving into provider-owned metadata. This also erases two existing provider-isolation violations (a claude-code import in core instance code, and the claude.ai fallback hardcoded in the SPA) — this issue's own "grep-clean core" acceptance criterion currently fails without any Codex code existing.
  • That seam refactor is split out as #6 (ready-for-agent) — it needs no Codex account and is fully testable with the existing provider fake. This issue is blocked on #6.
  • What remains here after #6: the codex provider package itself — spawn argv + model/effort catalogs, the login flow, workspace seeding (AGENTS.md / config in place of CLAUDE.local.md + settings), and incogni attribution parity. All of its fragile CLI couplings need live verification against a logged-in Codex CLI (the ADR-0008 standard: claude-code's couplings were verified live against a real session), which an AFK agent on this host cannot do — pointing toward ready-for-human at re-triage.

Next step: re-triage once #6 merges. Stays needs-triage until then (category: enhancement).

> *This was generated by AI during triage.* ## Triage Notes **What we've established so far:** - **The attach design question is resolved.** OpenAI's remote-connections feature cannot attach a headless Codex CLI session on a Linux server: it requires the Codex desktop App (macOS/Windows) as the connection host, pairing is a QR-code flow started from the App ("you can't set it up from the Codex CLI or IDE Extension"), and no per-session URL exists to capture (https://developers.openai.com/codex/remote-connections). There is no claude.ai-style deep-link analog to wait for. - **Decision: ship local-attach, don't block on the embedded remote interface.** A Codex session gets no web Open link. Manual sessions are driven via `tmux attach` on the lab host; the instance row shows a copyable attach command. AFK sessions are unaffected (the seed prompt travels in the spawn argv). The embedded remote interface remains the later UX upgrade and is not a dependency. - **Decision: deep-link capture becomes an optional provider capability** (a `DeepLinker` interface following the `ConnectingReporter` pattern), with the open-affordance fallback moving into provider-owned metadata. This also erases two existing provider-isolation violations (a claude-code import in core instance code, and the claude.ai fallback hardcoded in the SPA) — this issue's own "grep-clean core" acceptance criterion currently fails without any Codex code existing. - **That seam refactor is split out as #6** (`ready-for-agent`) — it needs no Codex account and is fully testable with the existing provider fake. **This issue is blocked on #6.** - What remains here after #6: the `codex` provider package itself — spawn argv + model/effort catalogs, the login flow, workspace seeding (AGENTS.md / config in place of CLAUDE.local.md + settings), and incogni attribution parity. All of its fragile CLI couplings need live verification against a logged-in Codex CLI (the ADR-0008 standard: claude-code's couplings were verified live against a real session), which an AFK agent on this host cannot do — pointing toward `ready-for-human` at re-triage. **Next step:** re-triage once #6 merges. Stays `needs-triage` until then (category: enhancement).
Author
Owner

This was generated by AI during triage.

Re-triage: #6 has merged

Category: enhancement (adding the category label — this issue only carried
needs-triage until now)

Per this issue's own prior triage notes, it was blocked on #6 and due for
re-triage once that merged. Confirmed:

  • #6 merged via PR #12 ("optional DeepLinker capability + provider-owned open
    affordance", ADR-0017). The DeepLinker interface now exists
    (internal/provider), CaptureDeepLink is gone from the mandatory
    AgentProvider seam, the instance service arms capture only for providers
    implementing it, and the SPA's open-state logic is data-driven rather than
    hardcoding claude.ai. The two provider-isolation violations this issue's
    "grep-clean core" acceptance criterion depended on are fixed.
  • This sandbox has no codex binary and no Codex CLI session — confirming
    the prior notes' concern still holds: the remaining scope (spawn argv, model/
    effort catalogs, the Codex login flow, workspace seeding, incogni attribution
    parity) all needs live verification against a logged-in Codex CLI, the
    same live-verification bar this repo already held claude-code to (ADR-0008:
    every fragile coupling "verified live against Claude Code 2.1.198, a real
    session"). An AFK agent on this host cannot authenticate a Codex account or
    drive a live Codex session to pin those couplings.

Why ready-for-human, not ready-for-agent: every remaining acceptance
criterion in this issue's body — spawn argv, auth flow, workspace seeding,
attribution parity — is a claim about Codex CLI's actual behavior that has to
be pinned against a real logged-in session, not inferred from docs. That's a
manual-verification blocker, not a missing-design one; the design question
(#6) is already resolved.

Out of scope (unchanged from the issue body):

  • The embedded remote interface roadmap item — not a dependency, per the
    already-resolved attach-story decision.

Relabeling needs-triageready-for-human, category enhancement added.

> *This was generated by AI during triage.* ## Re-triage: #6 has merged **Category:** enhancement (adding the category label — this issue only carried `needs-triage` until now) Per this issue's own prior triage notes, it was blocked on #6 and due for re-triage once that merged. Confirmed: - #6 merged via PR #12 ("optional DeepLinker capability + provider-owned open affordance", ADR-0017). The `DeepLinker` interface now exists (`internal/provider`), `CaptureDeepLink` is gone from the mandatory `AgentProvider` seam, the instance service arms capture only for providers implementing it, and the SPA's open-state logic is data-driven rather than hardcoding `claude.ai`. The two provider-isolation violations this issue's "grep-clean core" acceptance criterion depended on are fixed. - This sandbox has no `codex` binary and no Codex CLI session — confirming the prior notes' concern still holds: the remaining scope (spawn argv, model/ effort catalogs, the Codex login flow, workspace seeding, incogni attribution parity) all needs live verification against a **logged-in Codex CLI**, the same live-verification bar this repo already held claude-code to (ADR-0008: every fragile coupling "verified live against Claude Code 2.1.198, a real session"). An AFK agent on this host cannot authenticate a Codex account or drive a live Codex session to pin those couplings. **Why `ready-for-human`, not `ready-for-agent`:** every remaining acceptance criterion in this issue's body — spawn argv, auth flow, workspace seeding, attribution parity — is a claim about Codex CLI's actual behavior that has to be pinned against a real logged-in session, not inferred from docs. That's a manual-verification blocker, not a missing-design one; the design question (#6) is already resolved. **Out of scope (unchanged from the issue body):** - The embedded remote interface roadmap item — not a dependency, per the already-resolved attach-story decision. Relabeling `needs-triage` → `ready-for-human`, category `enhancement` added.
Author
Owner

This was generated by AI during triage.

Deployment note: getting the codex binary onto the sandbox PATH is now tracked separately in #74 (NixOS module: provider-keyed agentPackages with a pkgs.codex default, plus an agent tools baseline). This issue stays scoped to the AgentProvider implementation itself and remains ready-for-human for the live-CLI verification (login as the lab service user, spawn argv, seeding, attribution parity). nixpkgs ships the CLI as codex (codex-cli; 0.133.0 already in this host's store), so no packaging work blocks it.

> *This was generated by AI during triage.* Deployment note: getting the `codex` binary onto the sandbox PATH is now tracked separately in #74 (NixOS module: provider-keyed `agentPackages` with a `pkgs.codex` default, plus an agent tools baseline). This issue stays scoped to the `AgentProvider` implementation itself and remains `ready-for-human` for the live-CLI verification (login as the lab service user, spawn argv, seeding, attribution parity). nixpkgs ships the CLI as `codex` (codex-cli; 0.133.0 already in this host's store), so no packaging work blocks it.
Author
Owner

Superseded by #87, which re-specs the Codex adapter for the post-seam-hardening world: ADR-0033/0034/0035 obligations inlined, #80's two-tier conformance suite + checklist adopted as the definition of done, couplings pre-pinned from a 2026-07-10 online research sweep with the remaining unknowns as an explicit live-spike checklist. The decisions resolved in this issue's triage (no deep link / tmux attach, #6 seam refactor, #74 deployment split) carry forward unchanged and are referenced there. Closing in favor of #87.

Superseded by #87, which re-specs the Codex adapter for the post-seam-hardening world: ADR-0033/0034/0035 obligations inlined, #80's two-tier conformance suite + checklist adopted as the definition of done, couplings pre-pinned from a 2026-07-10 online research sweep with the remaining unknowns as an explicit live-spike checklist. The decisions resolved in this issue's triage (no deep link / tmux attach, #6 seam refactor, #74 deployment split) carry forward unchanged and are referenced there. Closing in favor of #87.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/coding-lab#2
No description provided.