perf(mcp): cache immutable bundled config discovery#79882
Conversation
|
Codex review: found issues before merge. Reviewed July 3, 2026, 11:44 PM ET / 03:44 UTC. Summary PR surface: Source +176, Tests +344, Docs +13, Generated 0. Total +533 across 10 files. Reproducibility: yes. at source level: current main and v2026.6.11 still key bundled MCP runtimes by session id, and the PR body provides repeated Docker terminal benchmarks showing the second matching session reuses the shared runtime in about 100 ms instead of paying another cold start. I did not run a live benchmark because this review is read-only. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land one maintainer-approved shared-runtime implementation with Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main and v2026.6.11 still key bundled MCP runtimes by session id, and the PR body provides repeated Docker terminal benchmarks showing the second matching session reuses the shared runtime in about 100 ms instead of paying another cold start. I did not run a live benchmark because this review is read-only. Is this the best way to solve the issue? No, not as-is. Workspace/config-keyed sharing is the right implementation layer for the fan-out problem, but this branch still needs a hashed shared runtime id, stronger primary config docs, conflict resolution, and maintainer acceptance of the new config/security boundary. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d68f877ac3e. Label changesLabel justifications:
Evidence reviewedPR surface: Source +176, Tests +344, Docs +13, Generated 0. Total +533 across 10 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
This pull request has been automatically marked as stale due to inactivity. |
844f4e0 to
ac11d58
Compare
Co-authored-by: Stephen Hebson <[email protected]>
ac11d58 to
af4b309
Compare
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>

Summary
tools/listcatalogs, backoff, and failures remain session-owned. Diagnostic-bearing discovery results are never cached. Cached input graphs are snapshotted, and every caller receives a deep-fresh result.What Problem This Solves
Equivalent session and requester-partition catalog preparations repeatedly performed synchronous bundle/plugin manifest discovery and MCP JSON loading. The repeated filesystem/config work delayed every fresh session even when the immutable inputs had not changed. This rewrite removes that repeat work without sharing live MCP state between sessions.
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Evidence
node scripts/run-vitest.mjs src/agents/agent-bundle-mcp-runtime-config.test.ts src/agents/agent-bundle-mcp-runtime.test.tsnode scripts/check-changed.mjs -- src/agents/agent-bundle-mcp-runtime-config.ts src/agents/agent-bundle-mcp-runtime-config.test.ts2743.04 ms; warm discovery110.08 ms;24.9xratio. This measures the synchronous preparation path only, not live MCP startup.Root Cause
loadSessionMcpConfigrebuilt the same bundle/plugin discovery and filtered catalog preparation for every call. Runtime reuse already had a content fingerprint, but immutable preparation had no process-lifecycle owner.Regression Test Plan
Notes for reviewers