Codex 0.143 Alpha Starts Charging Rent for Agent Runtime State

Codex 0.143 Alpha Starts Charging Rent for Agent Runtime State

Codex 0.143 alpha 9 is not the sort of release that gets a keynote slide, which is exactly why it is worth paying attention to. The release note itself is nearly empty, but the merged work behind it reads like a maintenance invoice for agentic coding: persistence bytes, resume memory, compaction state, MCP process lifecycle, dependency advisories, and reminder timing. That is the hidden runtime tax teams pay once a coding agent stops being a clever terminal trick and starts becoming a system that runs for hours, resumes later, and drags a fleet of tools behind it.

The headline is not “new model.” It is “the runtime is learning to account for itself.” OpenAI published Codex rust-v0.143.0-alpha.9 on June 23 at 18:56 UTC. Compared with the morning-covered 0.143.0-alpha.5, the tag is 16 commits ahead, touches 71 files, and carries 1,917 additions against 371 deletions. That is not a massive release by line count. It is a concentrated pass over the places where agent platforms get expensive, leaky, or nondeterministic after the demo ends.

Token spend is only the obvious bill

The most concrete accounting change is PR #29498, which instruments rollout persistence bytes. It merged at 16:26 UTC, changed seven files, and added 696 lines. Codex now samples 1% of persisted rollout items when metrics export is enabled, reporting JSON byte totals per item and per thread before and after filtering. Each item is tagged with its exact response or event variant, including nested turn-item kinds for conditionally persisted completion events.

That sounds like internal telemetry trivia until you operate agent sessions at scale. Coding agents do not merely spend input and output tokens. They produce streams of events, tool results, state transitions, replay data, compaction artifacts, safety metadata, and logs that need to be stored, filtered, resumed, and sometimes shipped to cloud storage. If a persistence policy saves too much, the bill shows up later as storage growth, slower resume, and traces nobody wants to read. If it saves too little, debugging becomes archaeology with missing layers.

The useful part here is granularity. A global “rollouts are large” metric is a complaint. Per-variant byte measurement is an engineering tool. It lets maintainers ask whether a specific event class earns its storage footprint, whether filtering is actually reducing durable size, and whether a policy change moves the cost curve before users notice latency or storage churn. Agent observability that cannot answer “which event kind made this session huge?” is not observability. It is a vibes dashboard.

Resume performance is part of the product

Another practical fix landed in PR #28426, which replaces repeated deep clones of resumed rollout history with Arc<Vec<RolloutItem>> sharing. The PR says an artificial 123 MB rollout benchmark motivated the change: resume was deep-cloning complete history several times for app-server response construction, thread persistence, and read-only accessors. The serialized representation stays the same, but the runtime stops copying the same giant history just because several consumers need to look at it.

This is the kind of optimization that separates a toy chat transcript from an agent workbench. Long-lived coding sessions are supposed to resume. They are supposed to survive a client restart, a cold app-server path, or a handoff between local and remote execution. If a large session becomes painful to reopen because the runtime repeatedly clones history, users will stop trusting resume and start manually copying context into fresh sessions. That is how platforms lose the very continuity they are trying to sell.

For teams building internal agents, the lesson is blunt: benchmark pathological histories, not just normal chats. A happy-path session with ten messages tells you almost nothing about week-long debugging, repeated tool calls, generated artifacts, and compaction. Create ugly rollouts on purpose. Measure memory, resume latency, and persistence overhead. If the agent is meant to become part of daily engineering work, the worst sessions are not edge cases; they are future enterprise customers.

Compaction cannot rewrite what the model saw

The correctness story is PR #29527, merged at 17:33 UTC with 323 additions and 137 deletions. Codex now has run_turn own the current Arc<WorldState> and pass that exact state into inline compaction and new-context-window replacement. The bug class is subtle: environment readiness can change between sampling requests during a turn. If compaction rebuilds world state instead of using the state the model just saw, the replacement history can disagree with the request and suppress the next environment update.

That is not a cosmetic mismatch. Context compaction is an editorial operation on the agent’s past. It decides what survives into the next window and what gets summarized away. If the runtime compacts against a fresher environment snapshot than the one actually presented to the model, it manufactures a slightly different history. In a conventional app, a few milliseconds of state drift may be harmless. In an agent runtime, the compacted history becomes the model’s memory. Drift becomes a lie the next turn inherits.

The fix is the right invariant: compact what happened, not what the environment happens to look like a moment later. Practitioners should steal that pattern. Any agent system with compaction, replay, or resumable state needs a clear distinction between live environment state and the specific state included in the model request. If those are allowed to blur, debugging becomes impossible because the transcript no longer describes the world the model acted on.

MCP refresh is process lifecycle, not config reload

PR #29608 fixes another production-grade failure mode: refreshed MCP managers could replace the published manager without shutting down superseded stdio processes if another task still retained an Arc to the old manager. The PR adds a process-level regression test that retains the old manager during refresh and verifies the old stdio process exits while the replacement remains available.

This is exactly where MCP stops being a protocol acronym and becomes operations. MCP servers are processes, auth contexts, sockets, tool registries, and sometimes external side effects. If refresh leaves stale stdio processes alive, the symptoms will be weird: duplicate tools, stale credentials, port conflicts, zombie processes, or a tool call reaching the server nobody thought still existed. Relying on reference drops as lifecycle policy is a bug wearing a Rust sweater. Codex now shuts down the manager returned by the atomic swap, which is the more honest contract.

The broader alpha.9 trail reinforces the same theme. PR #29659 renames reminder timing from model-request intervals to elapsed seconds, while preserving immediate first delivery and forced delivery after compaction changes the context window. PR #29650 pins hono to 4.12.25 and fast-uri to 3.1.1 to address advisories, including a percent-encoded path traversal issue, while avoiding a newer Hono version because the repository’s dependency policy requires packages to be at least seven days old. Even the dependency work shows release hygiene: patch quickly, but do not turn emergency response into supply-chain roulette.

The practical checklist is clear. Measure persistence volume by event type. Benchmark resume against comically large histories. Make compaction consume the exact state visible to the preceding model request. Treat MCP refresh as process lifecycle management with explicit shutdown, not as a config swap. Patch parser and path dependencies quickly, but keep dependency age and provenance rules intact.

Codex alpha 9 is not glamorous. Good. Glamour is not what makes agentic coding usable after a week of real work. The agent platform that wins will not be the one with the loudest prompt loop; it will be the one that can explain storage, resume latency, compaction state, and MCP process ownership when the session is too large, too old, and too important to rerun from scratch.

Sources: OpenAI Codex release rust-v0.143.0-alpha.9, PR #29498, PR #29527, PR #29608, PR #28426, OpenAI Codex MCP docs