Skip to content

perf(mcp-gateway): 0.13 backport, let a Bot's worker sessions share Crew's own MCP servers (#37695) - #37772

Merged
buluoray merged 1 commit into
release/0.13.0from
crew/slack/backport-0.13.0-worker-mcp-share
Nov 16, 2026
Merged

buluoray merged 1 commit into
release/0.13.0from
crew/slack/backport-0.13.0-worker-mcp-share

Conversation

@buluoray

@buluoray buluoray commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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 (head b45ee13fbcf). One commit, made with git cherry-pick -x. It applied with no conflict; nothing was hand-resolved.

Pick Main commit What 0.13 users get
#37695 f1b575f89592 The overlay pass rewrites kirocrew-mate-worker.json next to the conductor's spec, and worker_overlay_spec returns stubs for the base servers (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. 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*.py file plus every test file that mentions mate_overlays, session_servers, mate_worker or worker_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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 16, 2026 03:00
@buluoray
buluoray requested review from mbriones98 and removed request for a team November 16, 2026 03:00
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 1ca72812b53e42585c3d12b11c512337a4724f33 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 1ca72812b53e42585c3d12b11c512337a4724f33 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 ships

Inventory (6 items) — 6 justified

Intent: 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.

  1. The gateway now writes an overlay for the stock kirocrew-mate-worker.json next to the conductor's — justified
  2. KAS worker sessions get stubs for the base servers (kirocrew-core, cron, guide, mate, work) whether or not their Bot owns a file — justified
  3. Base-server stubs follow the governed merged spec: muted, dropped and registry servers are left out, disabledTools comes from the merged spec, and autoApprove is never sent — justified
  4. Worker and conductor stubs share one pooled backend, and each call keeps its own caller identity — justified
  5. Hosts other than KAS no longer get worker stubs by name, so they keep declaring their own servers. The rewritten pin is declared: "Without the KAS session key the worker overlay lookup answers nothing" — justified
  6. The mcp.md worker-lookup section is updated in the same commit — justified

[FIRST-PRINCIPLES-REVIEWED] 1ca7281

Description read

[DESCRIPTION-READ] f8cda0fc1a928e4ae0c442839a12c975e26b1cb328a6b09a46ee4ff6360b575f

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 1ca72812b53e42585c3d12b11c512337a4724f33 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The by-name refusal for kirocrew-mate-worker in session_servers._load_overlay_for_agent is now the only thing that stops a session without the merged limits from receiving <overlay_dir>/kirocrew-mate-worker.json. No test is mentioned that pins this refusal against a by-name lookup. If one doesn't exist, it is worth adding, because a later refactor that removes this branch would silently hand ungoverned stubs to non-KAS hosts.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 1ca72812b53e42585c3d12b11c512337a4724f33 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1ca7281

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 1ca72812b53e42585c3d12b11c512337a4724f33 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 1ca72812b53e42585c3d12b11c512337a4724f33 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 1ca7281

Verdict parsed from the review's SHA-scoped output markers for commit 1ca72812b53e42585c3d12b11c512337a4724f33.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 1ca72812b53e42585c3d12b11c512337a4724f33 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 16, 2026
…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)
@buluoray
buluoray force-pushed the crew/slack/backport-0.13.0-worker-mcp-share branch from 851b712 to 1ca7281 Compare November 16, 2026 03:41
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 16, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 16, 2026
@buluoray
buluoray merged commit 0502da9 into release/0.13.0 Nov 16, 2026
148 of 155 checks passed
@buluoray
buluoray deleted the crew/slack/backport-0.13.0-worker-mcp-share branch November 16, 2026 06:52
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant