Skip to content

fix(codex): skip oversized MCP catalogue and stop launch retries (#316) - #317

Merged
mubeda merged 4 commits into
mainfrom
release/v0.15.2-issue-316
Nov 7, 2026
Merged

mubeda merged 4 commits into
mainfrom
release/v0.15.2-issue-316

Conversation

@mubeda

@mubeda mubeda commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Why

Codex can close its shared JSON-RPC connection when a stdout line exceeds 8 MiB. An MCP catalogue response can trigger this even with toolsAndAuthOnly, and treating deterministic launch closes as retryable burns up to 20 launches while later messages wait. The production incident's exact emitting method remains unproven.

Closes #316

What

  • Remove mcpServerStatus/list requests and their catalogue loading/paging machinery. Codex MCP status comes from startup notifications; refresh republishes observed state without provider I/O.
  • Keep status scoped to the current connection/root, stage at most 64 pre-root notifications, and preserve the committed snapshot when opening fails or is cancelled.
  • Classify oversized stdio launch closes for Codex, Cursor and Grok as TransportLineTooLong, preserve the nested error, and stop automatic launch retries. Restart recovery leaves the original delivery uncertain for the existing Retry/Dismiss actions.
  • Preserve the existing transport limits. Add content-free Codex framing diagnostics and the delivery.failing class transport-line-too-long; pending methods are context, not proof of the offending emitter.
  • Add regression coverage and update architecture, profiler, user/testing documentation and the v0.15.2 changelog.

Scope

Base: aeebadd0c238338c8323cb1c8f8d19a8033e19e5 (main after #314).
Reviewed head: 56b62c8dce1e04658f59eb58dd079527c1bbbee3.

This is the reviewed #316 change plus changelog integration. MCP tool access is unchanged; the status popover may omit servers/auth state that emit no notification and may show Awaiting MCP status. No dependency, version, schema, or React component changes. PR #315 is separate.

This PR does not publish a release, move v0.15.2, enable publish=true, or request the seeded upgrade workflow. No production processes, databases, userdata or production port were used.

Verification

Retained Linux integration evidence applies to 5900c817deb9a4d2617079ff17767679c46cf551; the final commit changes only CHANGELOG.md. Claude Opus 5.5 medium delta review cleared the exact final head. No tests were rerun during this push/PR-only handoff.

Passed commands:

  • cargo test --locked --offline -p bibcode-server --lib -j 2 -- provider::codex::runtime::tests provider::codex::mcp_status::tests provider::codex::protocol::tests production::provider_runtime::delivery_failure_tests oversized_stdout production::turn_delivery::tests — 120 passed.
  • cargo test --locked --offline -p bibcode-server --test provider_codex -j 2 — 86 passed.
  • cargo test --locked --offline -p bibcode-server --test production_provider_runtime -j 2 — 205 passed.
  • cargo test --locked --offline -p bibcode-server --lib -j 2 — corrected isolated run: 5001 passed, 14 ignored.
  • cargo fmt --all --check.
  • cargo check --workspace --all-targets --locked --offline -j 2.
  • cargo clippy --locked --offline --workspace --all-targets -j 2 -- -D warnings.
  • node scripts/run-local-vp.mjs check and node scripts/run-local-vp.mjs run typecheck — checkout-local equivalents of vp check and vp run typecheck.
  • node scripts/run-local-vp.mjs run release:smoke.
  • node scripts/run-local-vp.mjs test run scripts/ci-platform-contract.test.ts — 47 passed.

Mutation proofs reproduced failure when restoring the catalogue request and when removing restart-recovery classification; the restored candidate passed focused coverage. Complete-caller coverage exercises the driver/delivery worker, one launch/attempt, preserved nested detail, uncertain state across service restart, and one finding.

The full workspace test graph (node scripts/run-local-vp.mjs run -r --concurrency-limit 1 test) was not wholly green locally. The desktop restart fixture has a preexisting EADDRINUSE race; uncontended exact reruns passed on base and candidate. The slow-link failure is detailed below. Main CI 42306937978 completed successfully before this branch was pushed; candidate PR CI will run separately.

UI.md was reviewed in the retained validation. No React changes require a React skill review. Affected runbooks were updated/reviewed; the Linux procedures remain accurate. Profiler coverage retains supervised launches and emits content-free framing diagnostics plus the existing delivery finding; no new RPC, process type, removal path, binary mode or shutdown service is introduced.

Private handoff evidence on ai-server: /tmp/bibcode-316-astra-integrate/PHASE1.md, GATES.json, host-network/, and /tmp/bibcode-316-claude-integ2/stdout.log.

Residual risks

  • F3, preexisting and nonblocking for this PR: an oversized thread/turns/list read-back after a successful launch can leave delivery in Sending and later messages queued. This is not fixed here. It remains a draft-only follow-up at /tmp/bibcode-316-handoff/ISSUE_F3_DRAFT.md, not a filed issue. The synthetic observation lasted 60 seconds; real emission and restart behavior were not proven.
  • Linux-only local gates: no native Windows/macOS packaged UI or real-provider proof is claimed for this candidate. Synthetic provider tests do not establish real-model MCP tool use.
  • Preexisting local slow-link failure: rpc_liveness::slow_links_finish_transfers_without_a_disconnect fails in this isolated local environment on both main and candidate, including outside the network namespace. Hosted CI passes the same main tree. This does not by itself block opening this PR, but its cause and real-user impact remain unresolved; candidate CI success is not claimed.
  • The live oversized-line emitter remains unknown. Other oversized responses still close the unchanged bounded transport, and notification-only MCP status has no catalogue backstop.

Remove MCP catalogue discovery in favor of bounded startup notifications, preserving same-thread continuation for the reproduced oversized catalogue failure. Keep the 8 MiB transport bound.

Apply Option A classification and private diagnostics to oversized launch closes. Preserve F1 restart recovery as Uncertain after one launch with the original error and delivery.failing finding.

Refs #316
Combine PR314 PTY setup failure handling with the Codex MCP catalogue skip
and bounded oversized-launch recovery, preserving candidate behavior.
Includes focused regression tests and provider, profiler, and validation docs.
Candidate 2b5b982 independently cleared by Claude; integration gates follow.

Refs #316
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T01:50:41.213446Z 56b62c8 PR opened
🔒 Security Review ✅ Completed 2026-11-07T01:52:30.386106Z 56b62c8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 7, 2026
@mubeda
mubeda merged commit e222d34 into main Nov 7, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex chat: stdout JSON-RPC line over 8 MiB closes the connection and exhausts delivery retries

1 participant