Repository navigation
fix(mcp): say a shared server is over the launch cap and how to fix it - #35205
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. It is a fix linked to #34488, and the cause is the Notes
What this change shipsInventory (7 items) — 6 justifiedIntent: let an operator see why a server set to share runs one copy per chat because it is over the 64-launch cap, and how to undo it. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] f3f5b8f Description read[DESCRIPTION-READ] 9b28d6972005cf6ce44ce135f4783d69d59bcf9057895c5e0f890bcec0a265ea 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: the change surfaces an existing refusal through the one read the page and the doctor share, and every reader I checked still works with the new reason. Notes
[DESIGN-REVIEWED] f3f5b8f Description read[DESCRIPTION-READ] f337af5cccab1850d8d67fabaae68e7594ab52714a941ffb9b060bc0dc8e38a4 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the diff adds one line of row copy, and screenshots shot-01, shot-05 and shot-06 show it. The Remove control is unchanged by this PR. Notes
[UX-REVIEWED] f3f5b8f Description read[DESCRIPTION-READ] c04ea106f91eec1c07f40f5f597d142736ce0001da928c7a71fe285cd78e8dbb That sha256 names everything this verdict read: the PR description, plus the 9 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 |
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: |
Code change approver recommendation: ApproveWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The PR makes refused_servers() return too_many_launches refusals as display-only records (complete:false, launch_cap, never expected_launch), keeps them out of refused_shares(), and stops a launch repeated after the cap from relabelling the reason. I checked every reader. The footprint now correctly counts the server as not shared. The stub approve endpoint still answers 409 (launch_over_cap fires before the stored refusal is compared). The doctor names the cause. On the dashboard, the row shows Can't share with Remove and no Approve, waitingForApproval leaves it out, and autoShareCandidates excludes it until the record clears. Tests cover each changed behaviour and would fail without the change. The GPT lane's blocking finding cites docs/decisions files this PR doesn't touch. The failing backend shard is an unrelated timing test, and the Coverage Gate failure is probably a knock-on from it (not confirmed). An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
buluoray
left a comment
There was a problem hiding this comment.
Approve on cae8d18. refused_servers() no longer drops too_many_launches, so MCP Management shows the row as Can't share with Remove plus a reason, and the doctor names it; the record never carries expected_launch, so nothing new can be approved. Two lanes block merge until Bolin acts: the hi string fails hiStyle, and UX Review BLOCKs the copy. Decisive lines: src/kiro_crew/mcp_gateway/launch_approval.py:1351 (over_cap record kept, complete false, launch_cap), src/kiro_crew/mcp_gateway/launch_approval.py:1368 (no expected_launch when over cap), src/kiro_crew/mcp_gateway/launch_approval.py:487 (a later launch keeps too_many_launches), website/src/i18n/locales/hi.json:16362 (trips the hi register gate)
cae8d18 to
9f8fea4
Compare
|
|
[operator: bolichen97] Thanks for the review. Both items you named are fixed in 9f8fea4: the Hindi line no longer uses a formal form, so |
9f8fea4 to
1528db6
Compare
|
Rebased: main moved in |
|
1528db6 to
4a573d1
Compare
57ef5d2 to
8abbafc
Compare
|
Rebased: main moved in [operator: bolichen97] |
|
[operator: bolichen97] The red |
8abbafc to
f1dec46
Compare
|
Rebased: main moved in [operator: bolichen97] |
|
[operator: bolichen97]
This PR changes only the MCP launch-approval read, the doctor line and the MCP Servers row, never the denied-command scanner or its test. The same node id is red on unrelated heads, for example #36630, a dashboard slot-settings fix (https://github.com/kirodotdev/KiroCrew/actions/runs/43431422828/job/131909310032, Not rerunning: this test has far more than two flake reports in the last 14 days, so its fix lands before another rerun. This PR waits for #28293 and re-syncs onto main once it merges. |
|
A server that more agent specs declare, each with its own arguments, than one approval can cover (the per-server launch cap) is refused as too_many_launches and runs inside every chat. refused_servers() skipped that record, so MCP Management showed the row with Share on, no Approve and no reason, and kirocrew doctor said nothing was waiting. refused_servers() now returns the record as display only: the launches the cap kept, complete false, launch_cap, and never expected_launch, so nothing can approve it. The row reads Can't share with Remove and says that too many agents start the server in different ways, names the limit, and tells the user to take it out of some agents, press Remove and turn Share back on. kirocrew doctor names the server and its cause and points at that row. share_refused still leaves it out, because the notice it feeds asks for an approval no approval can give. The cap and the launch_over_cap refusal are unchanged. Closes #34488
|
Rebased: main moved in [operator: bolichen97] |
f1dec46 to
f3f5b8f
Compare
|
[operator: bolichen97] Answers to the three optional notes in the review above. That review judged 57ef5d2, and the code each note names is the same on this head.
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head f3f5b8f. On the backend, refused_servers() now returns an over-cap refusal as display only: complete is false, launch_cap is set, and it never carries an expected_launch. refused_shares() still leaves it out of the approval notice. A launch repeated later in the same pass keeps the over-cap reason. I traced every reader of the refusal record: the status route, the stub approval handler (the over-cap 409 still fires first), the footprint count, the paused-share note and the doctor. None of them can now approve a server over the cap, and the dashboard row shows Can't share with Remove and no Approve. The related backend suites pass locally, a mutation check confirms the new admit test fails when the fix is reverted, and every CI check on this head is green, so nothing blocks.
Problem / Motivation
Goal: On MCP Management, a shared server that more agents declare than one launch approval can cover says so and names the way back, instead of showing Share on with no reason.
When more than 64 agent specs launch the same MCP server with different arguments, the gateway refuses it as
too_many_launchesand every chat runs its own copy. The page showed that row with Share on, no Approve control and no explanation, andkirocrew doctorreported nothing waiting; only the gateway log named the cap.Why it matters
An operator with many agent packages sees a server that looks shared while every chat starts its own copy, and neither the page nor
kirocrew doctorsays why or what to do. Installing one more package can push a server over the cap with no visible sign.Not a goal
launch_over_cap409 is unchanged.What changed (motivation → approach → change)
A server over the launch cap now says so wherever the refusal is read:
kirocrew doctornone waiting for approvaltoo many agents start it with different settings; take it out of some agents, then see its row on MCP Servers, and asks to approve only the servers that offer ApproveGET /api/mcp-gateway/statuslaunch_refusedleft it outshare_refusedstill leaves it outThe cause was one filter:
refused_servers()inmcp_gateway/launch_approval.py, the record both the page and the doctor read, skipped everytoo_many_launchesrefusal. It now returns that record as display only: the launches the cap kept,complete: false,launch_cap(the cap), and neverexpected_launch. A name the cap refused also keeps that reason for the rest of the gateway's pass, so a later agent repeating a launch the pass already holds no longer relabels it as merely unapproved.refused_shares()still leaves it out ofshare_refused, the list behind the notice above the server list on MCP Servers: that notice asks to press Approve sharing, which no approval can answer for a server over the cap. The page already draws a refusal with no approvable identity as Can't share with Remove and no Approve, so nothing new can approve it;notApprovableKeyinmcpManagementModel.tspicks the over-cap line for the row, while its Details keeps the general not-approvable line, so the over-cap line shows once; the status type inwebsite/src/api/client/mcp.tsnames the reason andlaunch_cap, and the line is translated in everywebsite/src/i18ncatalog.docs/architecture/mcp.mdand the user guideconnections.mddescribe the row.Backwards compatibility
Compatible:
launch_refusedgains one reason value and one optional field. A page that does not know the reason still readscomplete: falsewith noexpected_launchas not approvable and shows its general line; approval, the cap and every 409 are unchanged.Removes nothing: the diff only adds a record to an existing read and a line to the page and the doctor.
Tests
test/test_mcp_launch_approval.py::test_new_launch_is_refused_at_the_per_server_cap_and_expected_launch_survives: a stored over-cap refusal is listed withlaunch_cap, the launches the cap kept,complete: falseand noexpected_launch.test/test_mcp_launch_approval.py::test_a_launch_repeated_after_the_cap_keeps_the_cap_as_the_reason: a launch repeated after the cap leavestoo_many_launchesas the reason.test/test_doctor_mcp_share_refused.py::test_a_share_over_the_launch_cap_is_named_with_its_remedy: the doctor names an over-cap share with its cause and points at its row, not the raw reason.test/test_doctor_mcp_share_refused.py::test_refused_shares_keys_by_configured_name: a share over the cap is left out ofshare_refused.website/src/test/McpManagement.launchApproval.test.tsx"says a row over the launch cap is past the approval limit, with no approve control": the row shows the over-cap line once and Remove, and no Approve, and its Details gives the general line.Proof: PROVEN test/test_doctor_mcp_share_refused.py::test_a_share_over_the_launch_cap_is_named_with_its_remedy, test/test_doctor_mcp_share_refused.py::test_refused_shares_keys_by_configured_name, test/test_mcp_launch_approval.py::test_a_launch_repeated_after_the_cap_keeps_the_cap_as_the_reason (head f3f5b8f)
The vitest is red on the parent tree (the over-cap line does not exist there) and green here. Determinism: the four backend tests above 20/20 green at
-n0, 10/10 at-n 4besidetest_cli_doctor.pyandtest_mcp_launch_approval_rebind.py, and both changed files green in a shuffled order (seed 34488, 90 ids); the doctor over-cap test 20/20 at-n0and 10/10 at-n 4besidetest_cli_doctor.pyandtest_doctor_authored_agent_mcp_refs.py, and its file green in a shuffled order (seed 57, 33 ids); the over-cap vitest 20/20 at--maxWorkers 1, 10/10 at--maxWorkers 4besideMcpManagement.newLaunch.test.tsxandMcpShareRefusedNotice.test.tsx, and its file green shuffled (seed 34488).Manual verification
Screenshots below come from the built dashboard of this head (
npm run build), on the MCP Servers tab of Customize: the rows on its Sharing view and the notice above the server list on its Servers view, served locally withGET /api/mcp-gateway/statusansweringlaunch_refusedandshare_refusedexactly asrefused_servers()andrefused_shares()returned them for a real saved pass:notes-mcp, which 65 distinct launches took past the cap, and, for the notice,alpha-mcp, added outside the dashboard. "Before" is the same page fed what the old filter sent (no record), which is what the issue describes: the row reads shared with its switch on. "After Remove" presses the row's Remove and answers that write the way the gateway does (stub: false, the only write sent): the server is still listed and its switch is back, off. The notice above the server list namesalpha-mcp, which an approval clears, and notnotes-mcp.Real-machine verification
Machine: EC2 m7i.2xlarge, Ubuntu 24.04 x86_64, 8 vCPU / 32 GiB
Before (main 906ee87): the prepare-pr skill's
prove.py --base 906ee870275f, which puts main's code back under the changed tests -> the three backend tests named in theProof:line failAfter (head f3f5b8f): the same command ->
PROVENfor those three tests; on the same machine the related backend and frontend tests pass apart from three that fail on main too, every other gate passes, and the screenshots below come from this tree's built dashboardCleanup: instance terminated;
aws ec2 describe-instances --instance-ids <id>returns nothingScreenshots / video
Over the cap, after (dark):
After Remove: the server is still listed and its switch is back, off:
The notice above the server list names only the server an approval can share:
Before (the old status read left the record out, so the row claims shared):
Light theme, and Details open
Related Issues
Closes #34488
Sibling sweep
Swept: git grep -nE "REFUSED_TOO_MANY|too_many_launches|refused_servers" -- src website/src
Sibling: src/kiro_crew/doctor_checks/mcp.py -- changed here
Sibling: src/kiro_crew/mcp_gateway/launch_approval.py -- changed here
Sibling: src/kiro_crew/dashboard/handlers/mcp_gateway_routes.py -- not affected -- launch_refused carries the record from refused_servers() with no edit, and share_refused comes from refused_shares()
Sibling: src/kiro_crew/dashboard/handlers/mcp_gateway_stubs.py -- not affected -- an over-cap launch is refused with launch_over_cap before the stored refusal is compared
Sibling: src/kiro_crew/dashboard/handlers/gateway_footprint.py -- not affected -- it counts every refused name as unshared, the rule it already applies to a changed launch whose approved launches still run
Pattern harvest
Not generalizable: one reader dropped one refusal reason it could not act on; every other reason already reached the page and the doctor.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commits