Skip to content

Add Codex API, ChatGPT, and remote SSH runtimes - #494

Draft
eladrave wants to merge 9 commits into
LiteLLM-Labs:mainfrom
eladrave:agent/codex-app-server-runtime
Draft

Add Codex API, ChatGPT, and remote SSH runtimes#494
eladrave wants to merge 9 commits into
LiteLLM-Labs:mainfrom
eladrave:agent/codex-app-server-runtime

Conversation

@eladrave

@eladrave eladrave commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Adds Codex CLI app-server as a managed-agent compatibility runtime with three connection profiles:

  • Codex API: an OpenAI Responses-compatible base URL, API key, and model
  • Codex ChatGPT: Codex's native ChatGPT device authorization and persisted CODEX_HOME, without an OpenAI API key
  • Codex Remote SSH: a fixed codex app-server --listen stdio:// command on another machine, authenticated by password or private key

The change includes the runtime bridge container, profile/controller APIs, runtime configuration UI, Compose registration, template metadata, deployment documentation, and event-protocol tests.

Dependency

Depends on #493 for scalable completed-history replay and mobile session access. This branch intentionally keeps that general reliability fix in its own PR and should be rebased onto main after #493 lands.

Architecture

templates/codex/ is a self-contained compatibility bridge implementing the Anthropic Managed Agents API already consumed by the control plane. It:

  • pins Codex CLI because app-server is currently an experimental protocol
  • runs Codex app-server over stdio and maps managed-agent sessions to durable Codex threads
  • translates Codex JSONL notifications into normalized SSE runtime events
  • persists agents, sessions, and ordered events in SQLite
  • hosts multiple isolated profiles behind one controller registration
  • preserves the legacy root API for existing deployments

The control plane registers the controller once, then creates individual API, ChatGPT, or SSH runtime aliases through server-side controller calls.

Security model

  • the controller API key remains server-side and is not returned to the browser
  • profile credentials are encrypted at rest with AES-256-GCM
  • ChatGPT mode uses Codex account RPCs and never requires an OpenAI API key
  • SSH starts a fixed app-server command rather than accepting an arbitrary command
  • SSH host keys are pinned using either an operator-supplied fingerprint or trust on first use
  • profile responses return masked metadata rather than passwords, API keys, or private keys
  • this follows the control plane's current single-operator/master-key model; it does not add per-user ChatGPT or SSH credential isolation

Validation

  • cargo fmt --check
  • cargo test --release --locked: 212 passed; credential-dependent live tests remained ignored
  • npm run lint: zero errors and one pre-existing React hook warning
  • npm run build
  • Codex bridge unit suite: 13/13 passed
  • applicable browser suite: 8/8 passed, including API, ChatGPT, and Remote SSH configuration forms and native ChatGPT sign-in controls
  • Docker build and authenticated live smoke through Cloudflare
  • live model discovery, agent CRUD, session creation, SSE delivery, exact model response, and terminal idle completion
  • live OpenAI-compatible endpoint with gpt-5.6-sol-high
  • live Codex ChatGPT profile creation, authenticated account state, new turn, persisted session, and replay after reload

Generated file

src/model_prices_backup.json was refreshed by the repository's committed pre-commit hook during the feature commits. The feature does not change model-pricing behavior.

@deepankarmalhan-springhealth

Copy link
Copy Markdown

Is this adding support for ChatGPT managed agents? And if so, is there a general ETA around this?

@eladrave

eladrave commented Aug 7, 2026 via email

Copy link
Copy Markdown
Author

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