Skip to content

fix(mcp-gateway): 0.13 backport, fingerprint the backend package tree, not the repository HEAD (#37686) - #37759

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

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

Conversation

@buluoray

@buluoray buluoray commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Ship in 0.13 the fix that stops a website-only commit from turning off MCP sharing for every session.

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
#37686 9044daf1f34c The gateway code fingerprint names the backend package tree (HEAD:./ from the package root), not the repository HEAD. A commit that touches only website/ no longer makes every Crew MCP stub refuse the running gatewayd. The repo-named driver check now runs before the tree lookup, and every fingerprint git call sets GIT_NO_LAZY_FETCH=1.

No prerequisite is needed.

Why it matters

Without it, any commit with no Python change turns off MCP sharing for core, cron, guide and mate, conductor mode included, until the gateway restarts. On one host that lasted 13 hours (188 fallbacks), and each fallback made a new session slower than a plain launch.

Not a goal

What changed (motivation → approach → change)

Cherry-pick only. No hunk was hand-resolved and no line is new.

Backwards compatibility

Compatible. The fingerprint value changes once, so a gateway running the old build is restarted the first time a stub from this build meets it, as on any upgrade. Nothing is removed.

Tests

Test changes come from the pick (test/test_mcp_gateway_daemon_lifecycle.py, 37 passed).

The backend tests also ran locally on this head: the 353 test files that mention code_fingerprint, mcp_gateway or gatewayd. Under 6 xdist workers that run had environment failures (permission denied on the data home under load). Every file with a failure was then run again on this head and on clean release/0.13.0, the same way: 63 files, 3,191 passed and 1 failed on both. The one failure, test_kas_engine_refusal.py::test_the_probe_reads_the_refusal_from_a_real_start, fails on the clean release head too, so the pick does not cause it. 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 #37686.

Sibling sweep

Siblings: none -- the backport touches the same sites #37686 changed on main

Pattern harvest

Not generalizable: backport of an already-reviewed fix (#37686)

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 02:06
@buluoray
buluoray requested review from bolichen97 and removed request for a team November 16, 2026 02:06
@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 055c2fa52cc288f9f68d683a8f51f7ec2932a5f9 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

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 055c2fa52cc288f9f68d683a8f51f7ec2932a5f9 — 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 a fix already reviewed on main. It keys the fingerprint to the backend package tree, so a website-only commit no longer marks the daemon stale. It removes nothing, and same_scheme still holds.

Notes

  • The fingerprint value changes once at upgrade, so each upgraded host gets one daemon restart. That is the same as any release, and reverting the change undoes it cleanly.

[DESIGN-REVIEWED] 055c2fa

Description read

[DESCRIPTION-READ] 4bc006d2a7b5f8e2759fe4630d03f10826603b5bdc49d8a9d5dae1c109c6be4b

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

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 055c2fa52cc288f9f68d683a8f51f7ec2932a5f9 — 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

Nothing blocks. This is a clean cherry-pick of an already-merged fix. Moving the driver preflight earlier and pinning GIT_NO_LAZY_FETCH are both needed because HEAD:./ now reads tree objects from a tree the agent can write to.

What this change ships

Inventory (5 items) — 5 justified

Intent: ship in 0.13 the fix that stops a commit outside the backend package from making every MCP stub refuse the running gatewayd. FIX.

  1. A website-, docs- or CI-only commit no longer changes the gateway code fingerprint, so MCP sharing keeps working — justified
  2. A commit inside the package (an edit, an added module) still changes the fingerprint, and reverting it restores the old value — justified
  3. A repo with a repo-named exec driver now drops to the mtime rule before any git call, not just before the diff — justified
  4. Every fingerprint git call now sets GIT_NO_LAZY_FETCH=1, so a partial clone cannot run a planted uploadpack — justified
  5. The fingerprint value changes once on upgrade, so the old gateway restarts the first time a new stub meets it — justified

[FIRST-PRINCIPLES-REVIEWED] 055c2fa

Description read

[DESCRIPTION-READ] 4d729a34cb4373259554115a7b3303e229816d474583dac2674d297365bfed9e

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

Opus 5.5 Review — ✅ no blocking findings

Reviewed 055c2fa52cc288f9f68d683a8f51f7ec2932a5f9 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 055c2fa

Verdict parsed from the review's SHA-scoped output markers for commit 055c2fa52cc288f9f68d683a8f51f7ec2932a5f9.

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

@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 055c2fa52cc288f9f68d683a8f51f7ec2932a5f9 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 055c2fa

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 055c2fa52cc288f9f68d683a8f51f7ec2932a5f9 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
…itory HEAD (#37686)

* fix(mcp-gateway): fingerprint the backend package tree, not the repository HEAD

code_fingerprint() named the code by the repository's HEAD commit, so a
commit that touched only website/ (no Python) changed the fingerprint and
every Crew MCP stub refused the running gatewayd with "gateway code
fingerprint does not match this stub" until the gateway restarted. On one
host this turned off sharing for core/cron/guide/mate for 13 hours (188
fallbacks), and each fallback made a new session slower than a plain launch.

The git rule now uses the package directory's tree id at HEAD
(git rev-parse HEAD:./ from the package root). Any committed change under
src/kiro_crew still changes it, and the tracked-diff digest still covers
uncommitted edits.

* fix(mcp-gateway): refuse repo-named drivers before the tree lookup, and never lazy-fetch

Resolving HEAD:./ walks tree objects. In a partial clone a missing one is
fetched through the repository's own remote, so a planted
remote.<name>.uploadpack would run before repo_exec_driver_reason() was
consulted. The preflight now runs first, and every fingerprint git call
sets GIT_NO_LAZY_FETCH=1.

(cherry picked from commit 9044daf)
@buluoray
buluoray force-pushed the crew/slack/backport-0.13.0-mcp-fingerprint branch from dffe942 to 055c2fa 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: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 16, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 16, 2026
@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Nov 16, 2026
@buluoray
buluoray merged commit 1842d7c into release/0.13.0 Nov 16, 2026
257 of 269 checks passed
@buluoray
buluoray deleted the crew/slack/backport-0.13.0-mcp-fingerprint branch November 16, 2026 06:51
@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