Swapping Codex in as an AGNT fleet adapter in 30 minutes
AGNT's fleet layer is model-agnostic — adapters for claude_local, codex_local, and gemma_local all share the same interface. We swapped Codex into a running fleet without restarting any agents. Here's what the adapter looks like and where the gotchas are.
AGNT's fleet v2 architecture (shipped in v0.2) decoupled agents from model backends. An agent declares a preferred adapter — claude_local, codex_local, gemma_local — and the runtime resolves that adapter at spawn time. Swapping adapters is a hot-patch, not a restart.
We documented this path through a live swap: a content-writer agent running on claude_local was switched to codex_local in a single API-PATCH call. Total time from start to first completed task on the new adapter: under 30 minutes, most of which was setting up the Codex environment keys.
The adapter interface is narrow by design. Four methods: `complete(prompt, max_tokens)`, `stream(prompt)`, `supports_tools()`, and `health_check()`. Every model wrapper implements these and nothing else. Codex maps cleanly — its completion API has equivalent parameters, and the streaming interface translates 1:1.
Where it gets sharp: tool-calling semantics diverge. Claude's tool_use blocks are structured; Codex's tool calls are function-shaped. The adapter layer normalizes both into AGNT's internal ToolInvocation shape, but if you're writing a custom adapter, expect ~40% of the code to be schema translation.
The full walkthrough lives at /guides/ecosystem/swap-codex-as-fleet-adapter. It covers the API-PATCH request, the cwd preservation trick, the rollback path, and a short checklist for validating the swap before you trust it in production.
See also
Share this signal
Submit to
Public submit links. No API keys. Opens in a new tab with the title and URL pre-filled.