Repository navigation
fix(ci): MCP replacement proof stalls during provider discovery - #137639
Conversation
|
@clawsweeper re-review The final test-only head is |
|
Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 7:45 PM ET / 23:45 UTC. ClawSweeper reviewWhat this changesThe branch stubs and asserts the provider-auth warmup in the MCP plugin-replacement test so unrelated provider discovery cannot stall the credential-revocation proof. Merge readiness✅ Ready for maintainer review Keep open. This focused, maintainer-owned test reliability repair preserves the production reload call while preventing unrelated provider-auth discovery from delaying the MCP replacement proof; no blocking finding was identified. Priority: P3 Review scores
Verification
How this fits togetherGateway reload replaces plugin registry state, disposes MCP runtimes, and schedules cache refreshes. This test drives a plugin replacement through authenticated loopback MCP traffic, then checks that retired credentials cannot be reused and replacement routing works. flowchart LR
A[Authenticated MCP fixture] --> B[Gateway plugin reload]
B --> C[Registry replacement]
B --> D[Cache refresh scheduling]
D --> E[Provider auth warmup]
C --> F[Retired runtime disposal]
F --> G[Stale credential rejection]
C --> H[Replacement MCP routing]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +8. Total +8 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain this narrow test-only isolation and continue to cover provider-auth rewarm semantics in the gateway reload and provider-auth owner suites. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: plugin reload schedules the warmup, whose pre-worker lookup collection can execute during this focused MCP proof; the reviewed snapshot also records the affected CI timing evidence. Is this the best way to solve the issue? Yes. Stubbing the unrelated asynchronous refresh while asserting it was scheduled keeps the MCP credential-revocation boundary intact; its owner suites already cover the warmup behavior itself. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e93edb0af270. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…date-command * origin/main: fix(ci): retry transient npm advisory timeouts (#137716) fix: keep restored Usage navigation from being replaced by Chat (#137402) fix: keep Usage day totals within the selected session scope (#137396) refactor: reduce live digest scheduling allocations (#137655) fix(ui): submit selected slash arguments in new sessions (#137571) fix(ui): expand collapsed task progress on final (#137569) fix(test): prevent auth discovery from stalling MCP replacement proof (#137639) test(cli): reuse canonical directory mock call helper (#137640)
Related: #137502.
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.
What Problem This Solves
Resolves a problem where the authenticated MCP plugin-replacement test could time out while asserting that a retired handle rejects. The handle rejected immediately; unrelated provider-auth discovery occupied the test thread for roughly a minute before the assertion resumed.
Why This Change Was Made
The fixture already isolates prepared-model and context refresh, leaving the subsequent provider-auth warmup to discover providers from a deliberately unprepared catalog. It now isolates that third refresh boundary and asserts that the reload schedules it with the replacement configuration. Existing reload-order and provider-auth owner tests cover the excluded discovery work.
All real HTTP MCP traffic, credential checks, registry retirement, stale-handle rejection, request counters, replacement routing, and cleanup remain in the fixture. No production code, deadline, or behavior assertion is relaxed.
User Impact
CI retains the authenticated MCP replacement proof without spending roughly a minute on unrelated provider discovery. Application behavior is unchanged.
Evidence
On the exact failing CI merge, the unchanged file passed locally but repeatedly spent 52–60 seconds in this case. A CPU profile attributed 95% of the stalled interval to provider-auth discovery and source transformation after the stale call had already rejected. The exact CI timeout was 120 seconds under the original hosted child.
The unchanged 135-pattern hosted child passes: 1,771 tests across 89 files, with one pre-existing skip. The auth owners pass 35 tests across two files, and two targeted reload/disposal sibling cases pass. The final formatted MCP file passes all 12 tests; formatter, lint, and assertion-safety checks pass.
A sequential same-host benchmark measured 67.63 seconds and 2,303,036 KiB peak RSS before, versus 10.94 seconds and 2,100,532 KiB after; the affected case changed from 57,318 ms to 285 ms. These include test-launcher and source-transform overhead, not application-runtime performance.
Production delta: zero. Tests: +10/−2, net +8. The changed test and seven relevant owner/sibling files match current main before the patch. Independent Codex review completed all four context partitions with no P0–P2 findings. Exact-head CI 33817192970 passed, including the production dependency audit. Native preparation also passed.