Repository navigation
feat(mcp): resolve room-scoped servers during owned Codex startup - #797
bandzalkin wants to merge 2 commits into
Conversation
CodeQL diagnostic findingsFixing commits: bc0df019 removes wire-payload contents, 39c2d473 removes RPC method contents, and ad176506 adds the prelaunch Windows secret-bearing stdio refusal. RPC frame/queue diagnostics retain only event-kind and length metadata: queue drops identify server requests or notifications; parse/unknown-frame diagnostics retain their transport/type labels and length. No payload or method content is logged by these diagnostics. Forwarded error freezing is unchanged. Recorded CodeQL instances are fixed without dismissal. All seven bot threads below are resolved; the two existing replies remain. This summary replaces further per-thread replies. |
Source-Base: 97f8330 Source-Head: ad17650 Applied-Over: 22d8498 Conflict-Notes: None; exact source delta, excluding CHANGELOG.md and FORK-CHANGES.md Upstream-PR: band-ai#797
Source-Base: 97f8330 Source-Head: ad17650 Applied-Over: 22d8498 Conflict-Notes: None; exact source delta, excluding CHANGELOG.md and FORK-CHANGES.md Upstream-PR: band-ai#797
Source-Base: 97f8330 Source-Head: ad17650 Applied-Over: 1ab35a4 Conflict-Notes: band-ai#709 replaced Codex startup and retirement with RetainedRoom acquisition/release; keep its generation, enrollment and retryable-close ownership, port resolver/readiness/redaction into that owner and add cancellation guards. Dropped obsolete lifecycle fields and replaced deleted test helpers with codex/kit.py and lifecycleprofile.py. Inherited ownership and failed-close probes fail when their band-ai#709 mechanisms are removed, pass restored; no deleted upstream test files restored. Upstream-PR: band-ai#797
Source-Base: 97f8330 Source-Head: ad17650 Applied-Over: be88e79 Conflict-Notes: band-ai#709 replaced Codex startup and retirement with RetainedRoom acquisition/release; keep its generation, enrollment and retryable-close ownership, port resolver/readiness/redaction into that owner and add cancellation guards. Dropped obsolete lifecycle fields and replaced deleted test helpers with codex/kit.py and lifecycleprofile.py. Inherited ownership and failed-close probes fail when their band-ai#709 mechanisms are removed, pass restored; no deleted upstream test files restored. Upstream-PR: band-ai#797
Source-Base: 97f8330 Source-Head: ad17650 Applied-Over: be88e79 Conflict-Notes: band-ai#709 replaced Codex startup and retirement with RetainedRoom acquisition/release; keep its generation, enrollment and retryable-close ownership, port resolver/readiness/redaction into that owner and add cancellation guards. Dropped obsolete lifecycle fields and replaced deleted test helpers with codex/kit.py and lifecycleprofile.py. Inherited ownership and failed-close probes fail when their band-ai#709 mechanisms are removed, pass restored; no deleted upstream test files restored. Upstream-PR: band-ai#797
ad17650 to
81ed02c
Compare
|
Rebased onto current main ( |
81ed02c to
e38e7ff
Compare
|
Pushed |
Source-Base: d7ab342 Source-Head: e38e7ff Applied-Over: e53b5c6 Upstream-PR: band-ai#797
Source-Base: d7ab342 Source-Head: e38e7ff Applied-Over: e53b5c6 Upstream-PR: band-ai#797
Source-Base: d7ab342 Source-Head: e38e7ff Upstream-PR: band-ai#797
Port the reviewed cancellation correction from dd8f3af..942759f4. Delegate acquisition cancellation explicitly to the matching startup owner, preserve first abandonment/cleanup diagnostics, and cover public caller/cleanup orderings after uncancel. Keep Claude-owned retention changes in the stacked Claude PR.
Source-Base: d7ab342 Source-Head: 1b61d7c Upstream-PR: band-ai#797
Rebased onto main
d7ab3429cbdb(2026-10-15)Rebased onto current main (after #709, #804, #789/#775, #796 and #802) as one commit; head
e38e7ffb63dfd2daeeb415c9da3a6550d8ef9ed0. Integrated into #709's retained acquisition/release instead of restoring the removed lifecycle bookkeeping; sharedcore/retentionandturn_lifecyclegain the cancellation-settlement hooks the resolver needs (default stop budget unchanged). After the first CI run, Codex close no longer fails with "process leader remained unreaped" when a forced kill's exit is reported late (seen on Windows 3.12): it waits for the reap, as callers are already bounded by the room owner's budget; regressiontest_forced_close_waits_for_an_exit_reported_late.CHANGELOG.mdedits are dropped: Release Please generates it.Verified at the new head (macOS, Python 3.13):
uv sync --all-packages --locked --extra dev, all pre-commit hooks, and the fullpytest -q: 8708 passed, 738 skipped. Verification notes further down refer to the previous head.Summary
Resolve room-scoped external MCP servers inside owned Codex connection startup rather than capturing ambient configuration before room startup/cleanup ownership exists. Related: #709.
Changes
Diagnostic correction
RPC method and payload contents are never logged. Non-JSON/non-object/unknown payload diagnostics report transport, type and length; stderr diagnostics report byte length; cleanup diagnostics report exception type. Queue-full warnings report only the dropped event kind. A synthetic credential matching the old protocol-identifier grammar was reproduced in logs, so that grammar and its helper were removed in
39c2d473. No redactor runs in transport log paths. Forwarded error freezing/redaction is preserved. No CodeQL alert is waived.Test portability and observer corrections
The Windows held-resolver fixture matches the host-native workspace basename instead of a POSIX slash suffix. B retains its one-second startup bound while A remains held; A's admission/release are bounded and asserted. No product timeout increased.
The shared OpenCode wait_for test helper observes readiness before checking an expired deadline, fixing deterministically reproduced lost observations after a delayed poll. The one-second budget and 0.01-second interval are unchanged; false readiness at/after expiry fails without another wait. Four edge regressions remain. This is a test-helper change, not a shared product-runtime change; its exact failing coverage wake delay is unmeasured. Test-only changelog entries were removed.
Windows support boundary
ad176506refuses stdio servers with nonemptyenvon Windows during snapshot validation, before constructing or connecting a client. The safe category isunsupported-platform: “secret-bearing stdio MCP servers require POSIX exec”. Windows env-free stdio, all HTTP servers (including secret headers/bearer tokens), and POSIX behavior are unchanged. Windowsos.execvpespawns and exits rather than replacing the owned process; quoting alone cannot preserve ownership. No Windows supervisor is included; an owned supervisor is a separate follow-up.The refusal regression forces the platform predicate on every OS and checks the actual adapter construction boundary. The POSIX alias-launch/ownership case is skipped on Windows with that explicit reason; configuration-only POSIX tests force their platform, not the real launch case.
Stack and merge order
No prerequisite; based on upstream
d7ab3429cbdb5381b9ca572cf7eac210a8196052.Exact feature-only range:
d7ab3429cbdb5381b9ca572cf7eac210a8196052..e38e7ffb63dfd2daeeb415c9da3a6550d8ef9ed0.Merge #797 before #800, which includes this prerequisite. OMP and Copilot lanes are independent.
Testing
Final local correction scope: snapshot/launch, startup/recovery, 13 diagnostic cases and all 125 OpenCode consumers. Python 3.11.16: 265 passed / 1 eager-host skip; Python 3.12.14 and 3.13.14: 266 passed each. All five static hooks passed.
The method-privacy regression failed four cases before
39c2d473; all 13 diagnostics pass after it. Eighteen grammar/format cases were replaced with eight request/notification privacy cases. Actual parser output changed from disclosing a synthetic credential to event-kind-only warnings.The Windows refusal regression failed before the guard and failed again when the guard was removed; the restored interpreter matrix passed. Actual rendered error:
unsupported-platform: Codex MCP startup failed: secret-bearing stdio MCP servers require POSIX exec.The forced-Windows supported-transport case launches an env-free stdio target alongside secret-bearing HTTP without passing its aliases to that target.Prior published
200293f3had three Windows alias-launch failures, one Windows 3.13 PowerShell timeout and two high CodeQL alerts. The complete matrix and code-scanning clearance at this corrected head are awaited; the unchanged PowerShell test retains its timeout. No failure rerun, timeout relaxation or alert dismissal. Local proofs are not native-provider/live-room receipts or staged-package validation.