Skip to content

Run GPT through the Codex CLI (dev, do not merge yet) - #66

Closed
greenpolo wants to merge 3 commits into
mainfrom
dev
Closed

greenpolo wants to merge 3 commits into
mainfrom
dev

Conversation

@greenpolo

Copy link
Copy Markdown
Owner

What changes?

OpenAI becomes a harness provider, like Antigravity and Grok. Each GPT turn (main model or OpenAI worker) starts codex app-server, resumes that session's own Codex thread, and streams Codex's messages and actions back into Claude Code. Codex owns its login, tools, prompts, prompt caching and compaction; only the new part of the conversation is sent per turn.

  • New in plugins/multi-openai/src/: app-server.ts (JSON-RPC client, one process per turn), harness.ts (on the shared CliHarness), permissions.ts, progress.ts (Codex items → rows), request.ts, errors.ts. Models come from Codex's model/list; sign-in from account/read; quota via the same client.
  • Permissions: Plan → read-only sandbox with Codex MCP servers off; other modes → full access, approvalPolicy: never, no reviewer. Claude removing Edit+Write → read-only; WebSearch → web_search=disabled; mcp__server / mcp__server__tool denials → that Codex server or tool off (only servers Codex actually has, read via config/read). Shell and single Edit/Write removals have no Codex switch: one-line notice.
  • Core: runNativeCli gains a converse option (line-by-line stdin) for the app-server; hooks table marks openai as harness.
  • Removed: Responses request path, auth.json reader/refresher, compatibility note, and the direct-OpenAI live tests (compaction, instructions, cache, auto-mode, permissions, model-gateway). Added npm run test:live:codex.

Validation

  • npm run check passes.
  • Behavior changes have meaningful test coverage: npm run test:live:codex written, not yet run (needs a Codex login on the lab workstation).
  • User-facing changes are reflected in docs and CHANGELOG.md.

Smoke-tested in a signed-out container against Codex CLI 0.172: initialize → config/read → thread/start → turn/start → turn/completed round trip, thread resume, cancel (stops in ~2s), and a missing-thread error. Not run here: a real paid turn, typecheck:mod (needs Claude Code's generated types), Windows.

Review notes

  • Big behavior change: GPT as main model no longer uses Claude Code's tools/skills/plugins/hooks/Agent tool.
  • State: Multi's per-session records live in ~/.codex/multi-harness; Codex threads in $CODEX_HOME.
  • Windows: Plan's read-only sandbox may need Codex's one-time Windows sandbox setup.
  • Kept on dev for explicit testing before merge.

Generated by Claude Code

OpenAI becomes a harness provider like Antigravity and Grok: each turn
starts `codex app-server`, resumes the session's Codex thread, and streams
Codex's messages and actions back as text and display rows. Codex owns its
login, tools, prompts, caching and compaction; only the new part of the
conversation is sent each turn.

Plan maps to Codex's read-only sandbox with MCP servers off; other modes
run with full access and no approvals. Claude's Edit/Write, WebSearch and
MCP restrictions map onto Codex's sandbox and per-thread config. Models
come from Codex's own model/list.

Removes the direct Responses request path, the auth.json reader and
refresher, the compatibility note, and the live tests that exercised
them; adds test/live/native-codex.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyhDzXWWMVs7Kg4sabsibe
Runs one real task in a copy of the checkout plus a resumed follow-up, and
reports tokens, the cached share of input, and Codex quota before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyhDzXWWMVs7Kg4sabsibe
The response's standard usage carries only the last model call (Claude
Code reads it as the context fill), and text after an action row arrives
as the follow-up. Print the turn's summed usage and the full answer, and
mark the free replay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyhDzXWWMVs7Kg4sabsibe
@greenpolo greenpolo closed this Nov 28, 2026
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