Repository navigation
perf(mcp-gateway): 0.13 backport, let a Bot's worker sessions share Crew's own MCP servers (#37695) - #37772
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This is a clean cherry-pick backport of #37695 to 0.13. Each item removes a named startup cost or protects the governed-limits boundary, and no default or user-facing capability changes. What this change shipsInventory (6 items) — 6 justifiedIntent: give 0.13 users the change where a Bot's worker sessions reuse Crew's already-running MCP servers instead of starting their own copies. This is an ADDITION (perf), backported.
[FIRST-PRINCIPLES-REVIEWED] 1ca7281 Description read[DESCRIPTION-READ] f8cda0fc1a928e4ae0c442839a12c975e26b1cb328a6b09a46ee4ff6360b575f That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This is a clean cherry-pick of #37695. A worker reads the shared stubs only through its own KAS session record, so any other host gets no stub, which matches today's behaviour. Notes
[DESIGN-REVIEWED] 1ca7281 Description read[DESCRIPTION-READ] 7b38e6f34f30072f8431e9869b64bfe86a6a039ee0d0ed2451bc81fa60a8a71e That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 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: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
…ervers A worker session started its own kirocrew-core/cron/guide/mate/work, because the overlay pass never rewrote the stock worker spec and worker_overlay_spec skipped every base server. The pass now rewrites kirocrew-mate-worker.json next to the conductor's, and worker_overlay_spec returns its base-server stubs (shaped by the governed merged spec: muted, dropped and registry servers left out, disabledTools from the merged spec, autoApprove dropped) plus the stubs the Bot's own file adds. The worker overlay is never served by agent name: without the KAS session key the lookup answers nothing, so a host that cannot apply a worker's merged limits keeps declaring the servers itself. (cherry picked from commit f1b575f)
851b712 to
1ca7281
Compare
Problem / Motivation
Goal: Ship in 0.13 the change that lets a Bot's worker sessions share Crew's own MCP servers instead of starting their own.
Backport onto
release/0.13.0(headb45ee13fbcf). One commit, made withgit cherry-pick -x. It applied with no conflict; nothing was hand-resolved.f1b575f89592kirocrew-mate-worker.jsonnext to the conductor's spec, andworker_overlay_specreturns stubs for the base servers (shaped by the governed merged spec: muted, dropped and registry servers left out,disabledToolsfrom the merged spec,autoApprovedropped) plus the stubs the Bot's own file adds. Without the KAS session key the worker overlay lookup answers nothing, so a host that cannot apply a worker's merged limits keeps declaring the servers itself.No prerequisite is needed.
Why it matters
Today each worker session starts its own kirocrew-core, cron, guide, mate and work servers. A Bot that hands work to several workers pays that start-up cost for every one, and conductor mode makes it common. 0.13 should carry the shared path rather than ship it in the next release.
Not a goal
What changed (motivation → approach → change)
Cherry-pick only. No hunk was hand-resolved and no line is new.
Backwards compatibility
Compatible. A worker session that cannot use the shared path keeps declaring its own servers, as it does today. Nothing is removed.
Tests
Test changes come from the pick (
test/test_mcp_gateway_mate_overlays.py,test/test_mcp_gateway_pool_integ.py).The backend tests also ran locally on this head: every
test/test_mcp_gateway*.pyfile plus every test file that mentionsmate_overlays,session_servers,mate_workerorworker_overlay. That is 195 files: 7,841 passed, 0 failed. flake8 and black on every Python file in the diff: clean.Manual verification
N/A. Unit coverage above; the same change is on main.
Screenshots / video
N/A: no frontend change.
Related Issues
Backport of #37695.
Sibling sweep
Siblings: none -- the backport touches the same sites #37695 changed on main
Pattern harvest
Not generalizable: backport of an already-reviewed change (#37695)
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)