OpenAI Codex Multi-Agent v2 Per-Thread Runtime Routing: What Operators Need to Know
OpenAI Codex CLI 0.137.0 introduces multi-agent v2 with per-thread runtime routing, letting each spawned sub-agent carry its own model and provider choice. Here's what changes for operators managing gateway routing, cost attribution, and governance.
Archive item produced with AI assistance from the cited source and published without individual review. Editor of record: Joe Werner.

OpenAI Codex CLI 0.137.0, released June 4, 2026, introduces multi-agent v2 with per-thread runtime routing — a change that lets each spawned sub-agent carry its own model and provider choice instead of inheriting a single global endpoint. For engineering teams routing coding agents through an AI gateway, this architectural shift means routing decisions move from session-level to thread-level granularity. Combined with new enterprise credit limits, cloud-managed config bundles, and machine-readable plugin catalog output, the update reshapes how operators manage cost attribution, provider selection, and governance across multi-agent Codex deployments.
What Changed in OpenAI Codex Multi-Agent v2
The Codex CLI 0.137.0 changelog contains several operator-relevant changes:
Multi-agent v2 (PRs #25266, #25636, #25720–25722, #25841, #26114) is the headline update. Previously, all sub-agents spawned from a parent Codex session inherited the parent's runtime configuration — same model, same provider endpoint, same approval policy. In v2, each thread retains its own runtime choice. When the parent spawns a sub-agent, the child carries the parent's defaults but can override the model, provider, or sandbox independently. This creates a per-thread routing decision tree rather than a flat session-wide model assignment.
Enterprise credit limits (PRs #24812, #24617–24620, #24622, #25963) bring monthly credit caps at the seat-type level with per-user overrides. Business and Enterprise workspace admins can now set different spending ceilings for Codex seats versus ChatGPT seats. Cloud-managed config bundles let admins push centralized provider and model configurations to teams without per-user setup.
Remote-control RPCs (PRs #25675, #25785) let remote-control clients start pairing sessions, list controller grants, and revoke access through app-server v2. This is a governance surface: organizations running Codex in shared environments can now programmatically manage who controls which agent.
Machine-readable plugin output (codex plugin list --json, PRs #25330, #25457) enables CI pipelines and automation tools to enumerate available plugins without parsing terminal output. For teams building internal developer platforms on top of Codex, this makes plugin inventory programmable.
Hosted web and image tools expanded into more code-mode flows (PRs #25176, #25702, #25890, #25923), with parallel standalone web searches — meaning Codex sub-agents can now search the web concurrently rather than blocking on serial queries.
Why Per-Thread Runtime Routing Matters for AI Engineering Teams
The shift from session-wide to per-thread model choice has a concrete implication for teams running coding agents through a routing gateway: routing granularity increases by an order of magnitude.
Before multi-agent v2, configuring Codex to route through an AI gateway meant every sub-agent in a session hit the same model endpoint. The gateway could apply session-level routing rules — "route Codex requests to gpt-5 with fallback to deepseek-v4" — and every thread followed the same path.
With v2, each spawned sub-agent thread can carry its own model identifier. A parent agent orchestrating a complex task might spawn:
- A planning sub-agent routed to a reasoning-optimized model (e.g., gpt-5 or claude-opus-4)
- A code-generation sub-agent routed to a fast, cost-efficient model (e.g., deepseek-v4-flash or gpt-5-mini)
- A review sub-agent routed to a different provider for diversity (e.g., claude-opus-4 for adversarial review)
For operators managing provider routing, this means three things:
-
Fallback logic must be thread-aware. A blanket "if provider X is down, fall back to Y" rule still works at the gateway level, but cost attribution and latency SLA tracking now need per-thread context. Each sub-agent thread is a separate billing and reliability unit.
-
Credit limits interact with thread count. With enterprise credit limits now per-seat-type and per-user, and with each thread potentially using a different model at a different price point, cost forecasting for multi-agent sessions becomes nonlinear. A session that spawns 6 parallel sub-agents across 3 different models produces 6 separate credit consumption paths.
-
Config bundles propagate differently. Cloud-managed config bundles let admins push centralized settings, but per-thread runtime overrides mean individual threads can deviate from the admin's intended model routing policy. Operators need visibility into whether spawned sub-agents are respecting or overriding centralized configuration.
The Router/Operator Angle: What Changes for Gateway Routing
From a routing-layer perspective, Codex multi-agent v2 creates three new operational challenges for teams running multi-provider routing:
Session-to-thread mapping. Traditional AI gateways track requests at the session level — one session, one routing policy, one fallback chain. With per-thread runtime choice, a single Codex session can produce multiple concurrent requests to different providers. Gateways need to maintain thread-level routing state within a session context.
Cost attribution granularity. When each sub-agent thread selects its own model, billing reconciliation must attribute costs per-thread, not per-session. Enterprise teams running Codex through a shared routing gateway need request ledger entries that distinguish between the orchestrator thread and each spawned sub-agent, with the model and provider used by each.
Provider health signals per-thread. If a spawned sub-agent routes to provider A and hits a timeout, the routing layer should not mark provider A as unhealthy for the entire session. Per-thread routing means health signals and retry logic need thread-scoped context to avoid over-reacting to a single sub-agent failure.
Operator Checklist for Codex Multi-Agent v2
-
Verify your gateway supports concurrent multi-provider routing within a single session. If your routing layer assumes one session = one provider, multi-agent v2 will expose that assumption with cross-provider requests arriving in parallel.
-
Update cost attribution to include thread-level metadata. Codex v2 exposes
parent_thread_idon spawned agents — use this for hierarchical billing that distinguishes orchestrator from sub-agents. -
Test fallback behavior with mixed-provider sub-agents. Spawn a session with sub-agents routing to 2–3 different providers, then simulate one provider failing. Verify the gateway handles per-thread failover without cascading failures to sibling threads.
-
Audit config bundle propagation. If your organization uses cloud-managed config bundles, verify that per-thread runtime overrides are intentional and not accidental policy drift from the centralized configuration.
-
Instrument plugin catalog output. Use
codex plugin list --jsonin CI pipelines to verify available plugins and tools before Codex sessions start, especially for governance-sensitive deployments.
What TheRouter Users Should Watch or Try
TheRouter already supports OpenAI-compatible multi-provider routing, which means Codex traffic flows through the same request path as any other OpenAI-compatible client. With multi-agent v2, the key changes are:
-
Per-thread model routing is native. TheRouter's routing policies apply per-request, not per-session, so each Codex sub-agent thread gets its own routing decision automatically. No session affinity constraint prevents per-thread provider selection.
-
Request ledger entries capture per-thread context. Each Codex sub-agent request produces an independent ledger entry with model, provider, latency, and token counts — enabling thread-level cost attribution without custom instrumentation.
-
Fallback policies apply per-thread. If a spawned sub-agent's preferred provider is unavailable, the fallback chain triggers for that specific thread without affecting sibling threads or the parent orchestrator.
For teams exploring multi-agent Codex deployments, TheRouter's multi-provider routing and request ledger documentation cover the routing and cost-attribution patterns that multi-agent v2 makes more important.

rate-limit-reset-credits: Codex Remote Executor Routing
How Codex CLI rate-limit-reset-credits, remote executors, and encrypted Noise relays should route across hosts, MCP capabilities, policy, and billing.

Codex Record and Replay: macOS Skill Routing Guide 2026
Codex Record and Replay records a macOS workflow and turns it into a reusable skill. Govern each replay with approvals, permissions, fallback recovery, and cost telemetry.

Codex Windows Computer Use: Remote Control, Profiles, and Host-Level Routing
Codex Computer Use now works on Windows, with remote steering and Profiles for usage tracking. For AI engineering teams, the key shift is host-level routing: Windows agents need OS-aware identity, token accounting, and remote-control guardrails.