Repository navigation
feat(acp): serve codex from the shared runtime - #11267
Conversation
|
Intent: Make codex sessions run on the one shared adapter process Crew already knows how to drive, and delete the second spawn path once nothing routes to it — so there is one codex transport rather than two, and the harness that was written for it is the one actually used. Not a goal: closing codex's session-eviction gap ( |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify Windows CI is green on this head — the env-fold repair and RSS abstention only run there, and the checklist's CI item is unchecked. [DESIGN-REVIEWED] 921b1a6 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Eviction membership rests on a live measurement whose pinned test skips without the adapter installed, and the author states it "was not rerun" on this head — run What this change shipsInventory (10 items) — 10 justifiedIntent: route codex sessions through the one shared
[FIRST-PRINCIPLES-REVIEWED] 921b1a6 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsI have enough to conclude. Let me verify my reasoning on the one candidate:
I also confirmed the surrounding refactor is sound: no dangling references to removed symbols ( Nothing survives Step 1, and I found no grounded new defect in Step 2. No findings. [OPUS-REVIEWED] 921b1a6 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
self-added: yes
|
41f2376 to
900e3f2
Compare
|
self-added: yes
|
900e3f2 to
9985388
Compare
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
9985388 to
39abcb0
Compare
|
CI triage for Four checks went red. Two causes, one mine. Mine — fixed.
Worth naming the miss: I updated the fakes in Not mine — no action. A 388 KB gap between the peak gauge and the live reading it bounds — the two are sampled at Coverage Gate failed only on its "Require upstream coverage jobs to have succeeded" step, |
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
CI triage for Mine — Not mine — Not mine — Also in |
|
self-added: yes
|
|
CI triage for
A/B: the same test fails identically on a checkout of Everything else on this head is green: all four reviewers (GPT no blocking findings, Opus no findings, Design PASS, First-Principles PASS), every other test shard, lint, type check. |
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
Rebase onto Conflicts (all additive, both sides kept where both apply):
Main-side ratchet, answered rather than worked around: Local: gates green, mypy clean, 3088 tests across every file naming a capability set or the launch table. |
|
Rebase onto Conflicts, both sides kept: Main-side ratchets this head satisfies:
Local: gates green, mypy clean, 6664 tests across every file naming a capability set, the launch table, the cards or the goldens. |
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
Publication note for 3136f3a: the maintainer requested pushing the existing CI repairs for remote checks, with the incomplete local GPT review disclosed. No review override or merge is requested. The scoped repairs remove the graduated Black-baseline entry and measure launch environment deltas against the parent environment as installed by the OS. The launch golden remains unchanged; regression coverage reproduces the Windows SystemRoot case-fold failure and preserves genuine removals and POSIX case sensitivity. Verified locally on this commit: 532 focused tests, wheel build, mypy, Black baseline, targeted isort/flake8, documentation, harness parity, SDK boundary and comment-history checks. The complete local Opus contract review found no blockers. Local GPT discovery did not finish within its budget and authoritative falsification did not run; this is NOT a GPT pass. Served review models were not independently verified. Native Windows results remain for CI. The prior Windows queue-wait failure (14.999999999986358 versus 15.0) matches #11617 and #11702. The test and queue-wait code are unchanged from the base; the exact test passes locally on Linux. No timing threshold was weakened. |
|
self-added: yes
|
Codex sessions each got their own adapter process. CodexHarness was already written, registered and tested, but an env switch kept every session on the per-session AcpClient path, so the repository carried two codex spawn paths and used the worse one. Add codex to ACP_BACKENDS_ACP_RUNTIME and ACP_BACKENDS_SESSION_SHARING, delete the KIROCREW_CODEX_ACP_RUNTIME switch with acp_runtime_backends() and codex_runs_on_acp_runtime(), and delete the AcpClient codex spawn arm along with _is_codex, _codex_session_mcp_servers, the client-side protocol literal and its table row, and the _agent_mcp_capabilities attribute nothing else read. Two sets that transport membership used to stand in for now answer for themselves. ACP_BACKENDS_KIRO_SLASH_COMMANDS gates the cli.json overlay at the two sites that read and cleared it, because codex runs on the shared runtime and reads no such file. A new ACP_BACKENDS_SESSION_EVICTION names the harnesses whose teardown disposes a session; codex is absent, so _bg_runtime_backends keeps the high-churn background path off it. The runtime handle's refusal-envelope read is gated on ACP_BACKENDS_STRUCTURED_REFUSAL, as the client path already gates it. ReclaimPolicy gains rss_depth, and CodexHarness declares a core-only ceiling of 1024 MB over the adapter and its app-server. The measured per-session MCP fleet codex starts from its own config puts the whole subtree past the 500 MB default on the first prompt, and its size is set by the operator's config rather than by anything Crew did. Windows abstains from a bounded measurement rather than judging a core ceiling against a subtree total. Correct the refuted claim that codex-acp rejects an unadvertised mcpServers transport with -32600. It accepts one and answers normally, so the client-side narrowing is the only guard and its absence costs a silently unwired server rather than a failed request.
|
Pushed |
Problem / Motivation
Codex chats start separate adapter processes although the adapter can host multiple sessions. Crew also carries a second codex launch path behind
KIROCREW_CODEX_ACP_RUNTIME.Why it matters
One process per chat wastes memory. Two launch paths can disagree on tool delivery, teardown and diagnostics.
What changed (motivation → approach → change)
Codex uses
AcpRuntime. The preview switch and the codexAcpClientspawn arm are removed. Each session still has its own identity and tool roster. Codex remains outside shared-subagent session membership.agent_sdk/backends.py,acp/types.py,acp_backends.pyacp/harness/codex.py,acp/harness/base.py,acp/harness/__init__.pysession/closerequest. Core RSS uses a 1024 MB ceiling and a launcher-adjusted depth; an INFO log names the substituted operator threshold.acp/client.py,providers/acp.pyacp/runtime.py,acp/session_handle.py,acp/session_provider.py,session.pyagent_sdk/mcp_refs.py,providers/mirrors/codex.py,providers/mirrors/README.mdagent_sdk/backend_cards.pytest/, includingtest/acp_launch_capture.pyandtest/fixtures/acp_launch_goldens.json.github/black-baseline.txtdocs/system-specs/modules/The scope follows the four-PR plan and #10292, with the flip and duplicate-arm removal together. The recorded probe measured the adapter plus app-server separately from its per-session MCP fleet. The constant core ceiling is intentional; it is not an operator-configurable subtree limit. Windows bounded RSS remains unknown, so age still governs.
Backwards compatibility
Breaking:
KIROCREW_CODEX_ACP_RUNTIME,acp_runtime_backends()andcodex_runs_on_acp_runtime()are removed; codex uses the shared runtime by default. The selected provider remains ACP. Codex is not granted shared-subagent continuation.session/closeevicts in-memory adapter state rather than archiving the conversation withsession/delete.No credential-mask change is included in this verification repair.
AWS_CONFIG_FILEremains a documented gap: the existing read-only.aws/configexposure does not support wrappers that need to rewrite that file.Tests
SystemRootphantom-removal failure without changing the host platform. A separate test preserves real removals and POSIX case distinctions. Restoring the old comparison reproduces the CI failure.Manual verification
Earlier branch revisions passed four installed-adapter tests against codex-acp 1.11.0. They measured request-close eviction, notification-close non-eviction, idempotence and the two SSE shapes. They were not rerun for this test-only repair. A schema-complete SSE element with
headerscauses-32600for the whole request; the bare shape is accepted without wiring that server.The process-depth live pin and adapter observability follow-ups are tracked in #11512. This PR does not add an RSS configuration knob or an adapter-installing CI lane.
Screenshots / video
N/A — no new UI layout or visual interaction is introduced.
Related Issues
Closes #9976
Closes #10292
Overlap: #5349 concerns the codex client arm removed here; that PR is not modified.
Pattern harvest
Rule candidate: review-prompt
Pattern: transport membership does not imply a host's tool, overlay or teardown capabilities.
Checklist