Repository navigation
fix(mcp-gateway): 0.13 backport, fingerprint the backend package tree, not the repository HEAD (#37686) - #37759
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of 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 Notes
[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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a clean cherry-pick of an already-merged fix. Moving the driver preflight earlier and pinning What this change shipsInventory (5 items) — 5 justifiedIntent: ship in 0.13 the fix that stops a commit outside the backend package from making every MCP stub refuse the running gatewayd. FIX.
[FIRST-PRINCIPLES-REVIEWED] 055c2fa Description read[DESCRIPTION-READ] 4d729a34cb4373259554115a7b3303e229816d474583dac2674d297365bfed9e That sha256 names the PR description this verdict read. Recompute it with |
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: |
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: |
…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)
dffe942 to
055c2fa
Compare
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(headb45ee13fbcf). One commit, made withgit cherry-pick -x. It applied with no conflict; nothing was hand-resolved.9044daf1f34cHEAD:./from the package root), not the repository HEAD. A commit that touches onlywebsite/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 setsGIT_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_gatewayorgatewayd. 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 cleanrelease/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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)