Skip to content

fix(mcp): say a shared server is over the launch cap and how to fix it - #35205

Merged
bolichen97 merged 1 commit into
mainfrom
fix/34488-mcp-over-cap-reason
Nov 19, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/34488-mcp-over-cap-reason

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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_launches and every chat runs its own copy. The page showed that row with Share on, no Approve control and no explanation, and kirocrew doctor reported 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 doctor says why or what to do. Installing one more package can push a server over the cap with no visible sign.

Not a goal

What changed (motivation → approach → change)

A server over the launch cap now says so wherever the refusal is read:

Surface Before After
MCP Management row Share on, no Approve, no reason Can't share with Remove, and one line: too many agents start this server with different settings (the limit is 64); take it out of some agents, then press Remove: the server stays, only sharing stops, and its switch comes back so you can share it again
kirocrew doctor none waiting for approval names the server: too 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 Approve
GET /api/mcp-gateway/status launch_refused left it out lists it, display only; share_refused still leaves it out

The cause was one filter: refused_servers() in mcp_gateway/launch_approval.py, the record both the page and the doctor read, skipped every too_many_launches refusal. It now returns that record as display only: the launches the cap kept, complete: false, launch_cap (the cap), and never expected_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 of share_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; notApprovableKey in mcpManagementModel.ts picks 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 in website/src/api/client/mcp.ts names the reason and launch_cap, and the line is translated in every website/src/i18n catalog. docs/architecture/mcp.md and the user guide connections.md describe the row.

Backwards compatibility

Compatible: launch_refused gains one reason value and one optional field. A page that does not know the reason still reads complete: false with no expected_launch as 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 with launch_cap, the launches the cap kept, complete: false and no expected_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 leaves too_many_launches as 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 of share_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 4 beside test_cli_doctor.py and test_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 -n0 and 10/10 at -n 4 beside test_cli_doctor.py and test_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 4 beside McpManagement.newLaunch.test.tsx and McpShareRefusedNotice.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 with GET /api/mcp-gateway/status answering launch_refused and share_refused exactly as refused_servers() and refused_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 names alpha-mcp, which an approval clears, and not notes-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 the Proof: line fail
After (head f3f5b8f): the same command -> PROVEN for 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 dashboard
Cleanup: instance terminated; aws ec2 describe-instances --instance-ids <id> returns nothing

Screenshots / video

Over the cap, after (dark):

MCP Management: notes-mcp reads Can't share with Remove and the over-cap line

After Remove: the server is still listed and its switch is back, off:

MCP Management after Remove: notes-mcp is listed with its sharing switch off

The notice above the server list names only the server an approval can share:

The share notice names alpha-mcp and not notes-mcp

Before (the old status read left the record out, so the row claims shared):

MCP Management: notes-mcp reads shared with its switch on

Light theme, and Details open

Light theme: the over-cap row

Details open: the row keeps the over-cap line once, and Details gives the general line and the launches the cap kept

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

  • A Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commits
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 11, 2026 09:38
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f3f5b8fecfe6a6ca042ef5ba7b8fd741681b068d — 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. It is a fix linked to #34488, and the cause is the continue filter in refused_servers(), which the change removes rather than working around.

Notes

  • Item 3 — rides along: "approve each one that offers Approve" changes the doctor's instruction for every refused share, not only for a server over the cap. It belongs to this fix only because the doctor now lists servers that offer no Approve. Subtraction: none; it is the smallest wording that keeps the instruction accurate.

What this change ships

Inventory (7 items) — 6 justified

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

  1. The MCP Management row for an over-cap server reads Can't share, with Remove and a line naming the cap and the way back — justified
  2. kirocrew doctor names the over-cap server, its cause and where to fix it — justified
  3. The doctor's general instruction now says to approve only the servers that offer Approve — rides along
  4. launch_refused in /api/mcp-gateway/status now lists over-cap servers, display only, with launch_cap and no expected_launch — justified
  5. The notice above the server list still leaves out over-cap servers, because no approval can clear them — justified
  6. A launch repeated later in the same gateway pass no longer replaces the cap reason with "unapproved" — justified
  7. The row's Details keeps the general not-approvable line, so the over-cap line appears once — justified

[FIRST-PRINCIPLES-REVIEWED] f3f5b8f

Description read

[DESCRIPTION-READ] 9b28d6972005cf6ce44ce135f4783d69d59bcf9057895c5e0f890bcec0a265ea

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 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

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

  • The doctor still counts an over-cap server under "launch not approved", and its opening sentence still says "until it is approved on the dashboard". No approval can clear that refusal, so the count line misleads for this case even though the per-server label is right.

[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 .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 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

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

  • approval_over_launch_cap: "Take it out of some agents" names no place to do that. The blind reader said they were "only guessing how to 'take it out of some agents' because there's no link." Link the agent list, or name the page that edits an agent's servers.
  • On an over-cap row, Details still shows approval_not_approvable_here ("command cannot be approved for sharing"). The blind reader asked "whether these are one problem or two." Have notApprovableKey pick the over-cap line for Details too, or drop the general line on that row.
  • The new line still lets the label "Remove" read as deleting the server. The reader said they "would not dare press it." Use "Stop sharing" so the button says the outcome and the small print no longer has to undo the word.

[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 .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 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] f3f5b8f

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

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

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f3f5b8f

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

@bolichen97
bolichen97 enabled auto-merge (squash) November 11, 2026 09:48
@KiroCrewCaptain

KiroCrewCaptain commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: 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 f1dec46b31 · 146 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

buluoray
buluoray previously approved these changes Nov 11, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@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 11, 2026
@bolichen97
bolichen97 force-pushed the fix/34488-mcp-over-cap-reason branch from cae8d18 to 9f8fea4 Compare November 11, 2026 21:57
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • The over-cap remedy line doesn't tell the user how to recover span=d83e6be6c7b1

fixed in 9f8fea4: the line now reads "Too many agents start this server in different ways (the limit is {{cap}}). Take it out of some agents, then press Remove to stop sharing it and turn Share back on." It drops "launches", "declared" and "approval", says what Remove does, and names the Share switch the row shows after Remove.
The same wording is in all 12 catalogs and en-XA, the kirocrew doctor label, connections.md and docs/architecture/mcp.md; the screenshots in the body are re-captured from 9f8fea4.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Thanks for the review. Both items you named are fixed in 9f8fea4: the Hindi line no longer uses a formal form, so hiStyle passes, and the over-cap line is rewritten in task words for the UX Review finding (the disposition above has the text). The rest of the change is as you reviewed it.

@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 11, 2026
@bolichen97
bolichen97 force-pushed the fix/34488-mcp-over-cap-reason branch from 9f8fea4 to 1528db6 Compare November 12, 2026 09:39
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/dashboard/handlers/updates.py and test/test_update_boot_apply.py since this head's CI ran (f9788c5 -> 80cf3df): the two backend tests red here, test_updates_handlers_facade.py and test_wait_discipline_ratchet.py, failed the same way on main and #35625 fixed them there. CI re-running.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • The remedy depends on a control the reader is afraid of span=9b7ed005cf5c

fixed in 1528db6: the line now reads "Too many agents start this server with different settings (the limit is {{cap}}). Take it out of some agents, then press Remove: the server stays, only sharing stops, and its switch comes back so you can share it again."
It says Remove keeps the server and only stops sharing, and it names the switch the row draws once Remove takes the mark off, not a Share switch the row does not show yet.
The same wording is in all 12 catalogs (the take-out step and the Remove label use different verbs in each), en-XA, the kirocrew doctor label, connections.md and docs/architecture/mcp.md.
A new screenshot presses Remove on the built page: the server is still listed, reads direct, and its switch is back, off.
[operator: bolichen97]

@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 12, 2026
@bolichen97
bolichen97 force-pushed the fix/34488-mcp-over-cap-reason branch from 1528db6 to 4a573d1 Compare November 12, 2026 18:50
@bolichen97
bolichen97 force-pushed the fix/34488-mcp-over-cap-reason branch from 57ef5d2 to 8abbafc Compare November 13, 2026 06:29
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/architecture/mcp.md, src/kiro_crew/docs/connections.md and 26 more files this PR touches or imports since this head went green (82d7af1 -> 27e9359); CI re-running. The red Backend Tests shard 8 on 57ef5d2 (test/test_reply_format_once.py::TestEveryMessageWhereTheBlockCannotBeTakenOut::test_the_table_names_every_selectable_harness) was main's: the same node id is red on main in https://github.com/kirodotdev/KiroCrew/actions/runs/43352384263 after #24732, and #36290 fixed it on main; this base carries that fix. The other reds on 57ef5d2 were the CI token's API rate limit, not a verdict on the code. The patch is unchanged (git range-diff reports it identical), and the screenshots are re-captured on the MCP Servers tab of Customize, where #36241 moved the page.

[operator: bolichen97]

@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 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The red Backend Lint & Type Check (3.12) on 8abbafc comes from main, not from this PR: mypy fails at src/kiro_crew/cli_commands_memory.py:335, a file this PR does not touch, since #36212 landed on main. The test shards and Coverage Gate were skipped behind that lint failure. #36457 fixes it (tracked in #36458). This PR waits for that fix to merge, then rebases onto it so CI runs again.

@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 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Re-sync budget reset: the only red on 8abbafc is main's mypy error in src/kiro_crew/cli_commands_memory.py, fixed on main by #36457 after this branch's base, so this PR re-syncs onto it once more. Kept inside the PR's 48-hour watch window.
[operator: bolichen97]

@bolichen97
bolichen97 force-pushed the fix/34488-mcp-over-cap-reason branch from 8abbafc to f1dec46 Compare November 13, 2026 12:18
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/architecture/mcp.md, src/kiro_crew/docs/connections.md and 32 more files this PR touches or imports since this head's CI ran (27e9359 -> c22557c); CI re-running. The red Backend Lint & Type Check (3.12) on 8abbafc was main's mypy error at src/kiro_crew/cli_commands_memory.py:335, a file this PR does not touch; #36457 fixed it on main, and this base carries that fix. The patch is unchanged (git range-diff shows only context lines moved, next to the row hint in McpManagement.tsx), and the screenshots are re-captured from this head.

[operator: bolichen97]

@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 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Backend Tests (3.12, 7) is red on this head (f1dec46b31) only because of the known wall-clock flake tracked in #28212, whose fix is open in #28293.

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, 2k tokens took 0.534s). Coverage Gate fails only because that shard failed. Every review lane passes on this head.

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.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Superseding decisions require the maintainer override gate span=cb1ad4b321c2
    self-added: no

Rebutted: not a defect of this PR. It adds, edits or removes no file under docs/decisions/: git diff --name-only c22557cd83...f1dec46b31 lists 23 files, none of them a decision record.
docs/decisions/2026-11-14-conductor-mode-graduates-from-feature-previews.md and the four listed sites exist neither at this head's base (c22557c) nor at this head; they landed on main afterwards (#37550, #36187, #36291, #36924), so the lane judged main's commits as this PR's.
The PR changes how an MCP server over the launch cap is reported; it supersedes no recorded decision and does not touch conductor mode or its preview default, so recorded-decisions-are-not-regressions has no subject in this diff.
[operator: bolichen97]

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
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/architecture/mcp.md, src/kiro_crew/doctor_checks/mcp.py, website/src/pages/settings/McpManagement.tsx and 17 more files this PR touches since this head's CI ran (c22557c -> 906ee87); CI re-running. The test red on f1dec46 was Backend Tests (3.12, 7), the wall-clock flake test_the_scan_is_linear_not_quadratic (#28212) in a file this PR does not touch; #28293 fixed it on main and this base carries that fix, and Coverage Gate and PR Readiness were red only because of it. The GPT red on f1dec46 named decision records that main added after that head's base and this PR does not contain (disposition above); on this base they are base content, not part of the diff. The patch is unchanged (a range diff shows the same commit), the related tests and gates pass on this tree apart from reds main has too, and the screenshots in the description are re-captured from this head's tree.

[operator: bolichen97]

@bolichen97
bolichen97 force-pushed the fix/34488-mcp-over-cap-reason branch from f1dec46 to f3f5b8f Compare November 19, 2026 19:35
@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 19, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[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.

  • doctor_checks/mcp.py, the count line launch not approved: kept. It is the one count line for every refusal reason, and test_refused_share_is_reported_as_an_issue_with_the_approve_path pins it. On the line above it, the over-cap server's own entry gives the cause and the way back (too many agents start it with different settings; take it out of some agents, then see its row on MCP Servers). The advice asks the operator to approve only the servers that offer Approve. Rewording the shared count line for each reason is outside this fix.
  • test/test_doctor_mcp_share_refused.py, the label read from _SHARE_REFUSAL_LABELS: kept. If the over-cap entry is missing, the doctor prints the raw too_many_launches (the lookup falls back to the reason) and the assertion fails. So the test pins that the server shows its own label. The wording is reviewed copy, not behaviour.
  • The sibling line for gateway_footprint.py: that file needs no edit, and the line says so. Its reason states the effect: the file counts the over-cap server as unshared, the same rule it already applies to a changed launch.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 19, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bolichen97
bolichen97 merged commit 436d851 into main Nov 19, 2026
101 of 103 checks passed
@bolichen97
bolichen97 deleted the fix/34488-mcp-over-cap-reason branch November 19, 2026 23:56
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 19, 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.

MCP launch approval: a server past the 64-launch cap can never be approved, and the MCP page hides why

3 participants