Skip to content

fix(mcp-gateway): render a refused share through ErrorNotice - #25660

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/mcp-share-refused-error-notice
Oct 29, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/mcp-share-refused-error-notice

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A refused MCP share shows as a real error, with the "Ask the agent" hand-off.

On Customize > Connections > MCP Servers, a server set to share whose launch the gateway refused was shown in a hand-written warn box (role="status") with no agent hand-off. GPT 6.1 flagged it on the 0.11.0 backport #25643 under the blocking errors-use-error-notice rule.

Why it matters

The refusal comes from LaunchApprovals.admit() rejecting the launch, reported as share_refused by /api/mcp-gateway/status. That is a failure. Without ErrorNotice the user gets no hand-off and no structured error context, so it is a dead end.

Not a goal

  • No change to when a share is refused, or to the approval flow in MCP Management.
  • No change to the status-read failure notice, which already uses ErrorNotice.

What changed (motivation → approach → change)

Symptom: a hand-written box, no hand-off → cause: #23917 drew the refusal by hand → change: McpShareRefusedNotice renders it through ErrorNotice. The "N servers set to share are not shared" sentence is the message. The restart hint and the Review in MCP Management link go in the footer, unchanged. askAgent is on, and it stays off while the page holds staged edits (stagedChanges), where the link also keeps opening a new tab, so the hand-off cannot drop them. The capture harness scripts/capture-21058-mcp-share-refused.mjs waits for the link's current path, /settings/developer/mcp-pool (moved in #24810).

Backwards compatibility

Compatible: same props, same test id (mcp-share-refused), same text and link.

Removes nothing: the box is restyled and gains a hand-off; nothing it showed is dropped.

Tests

  • src/test/McpShareRefusedNotice.test.tsx: two new tests. The refusal has role="alert" and the hand-off; with stagedChanges there is no hand-off. vitest run over it and the McpTab suites: 6 files, 100 passed. tsc --noEmit and eslint are clean.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Shot from the real built SPA with /api/** stubbed (node scripts/capture-21058-mcp-share-refused.mjs).

Screenshots / video

Refused share, now an error notice with the hand-off (dark, then light):

refused share, dark

refused share, light

The status-read failure notice, unchanged:

status read failed, dark

Related Issues

Follow-up to #23917. Found on #25643.

Sibling sweep

Swept: git grep -n 'role="status"' -- website/src/pages/overview/
Siblings: none -- the other overview role="status" boxes show progress, success or warnings, not a failed request

Pattern harvest

Not generalizable: errors-use-error-notice already covers this class; the miss was one call site in review.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 29, 2026 05:18
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

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

The documented errors-use-error-notice rule requires this change. The one rider fixes a stale URL in a capture script and carries no risk.

What this change ships

Inventory (4 items) — 3 justified

Intent: when the gateway refuses an MCP server share, the user sees it as an error and can hand it to the agent. FIX.

  1. The refused-share box is now styled as an error (role="alert") instead of a warning (role="status") — justified
  2. The refused-share notice now offers "Ask the agent", but not while the page holds staged edits — justified
  3. The restart hint and the "Review in MCP Management" link now sit in the notice's footer; the text is unchanged — justified
  4. The screenshot script now waits for /settings/developer/mcp-pool, which is what MCP_MANAGEMENT_PATH holds — rides along, because it fixes a stale path left by feat(settings): merge the Developer page into Settings > Developer #24810

[FIRST-PRINCIPLES-REVIEWED] d895a90

Description read

[DESCRIPTION-READ] b71f4d4be9c49b6913f39d784e45c2e885bed66ff8963952cd086a097bd6d65c

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 Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks. The change reuses the existing ErrorNotice with the same staged-edits rule as the status-read failure notice next to it, and the three attached screenshots show the new surface.

[DESIGN-REVIEWED] d895a90

Description read

[DESCRIPTION-READ] 3be21433fece25c07a95e4a169721daef0ee306495e2215beefdd9eb453f16c6

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 Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks: the copy and link are unchanged, and the restyle and "Ask the agent" hand-off are visible in shots 01–03. The blind reader read the hand-off correctly.

Notes

  • No screenshot shows the variant with staged edits, where askAgent={!stagedChanges} hides "Ask the agent". The status-read notice already hides it the same way, so this is a note, not a gap. A shot with a pending edit would make the coverage complete.
  • share_refused_restart points to "Settings → About → Restart gateway" while "Apply & Restart" sits on the same page. The blind reader asked: "Is this the same 'restart' the red box asks for?" The string predates this PR, but the new red, more prominent box makes the clash easier to see. Say whether "Apply & Restart" is enough, or name the gateway restart in terms that set it apart.

[UX-REVIEWED] d895a90

Description read

[DESCRIPTION-READ] fe1d08df773ca77a65e64bd3112d551eca5470038b3d7da8ed5975186097e209

That sha256 names everything this verdict read: the PR description, plus the 6 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 Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] d895a90

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

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

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d895a90

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

A share the gateway refused is a launch LaunchApprovals.admit()
rejected, so it is an error surface, but the MCP Servers list drew it
in a hand-written warn box with no agent hand-off. Render it through
ErrorNotice: the restart hint and the MCP Management link ride in the
footer, the hand-off is on, and it stays off while the page holds
staged edits (the link still opens a new tab then). The capture
harness follows the link to its current Settings > Developer path.

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

Approved on behalf of the watch holder (bolichen). Design and First Principles pass on this head, UX skipped or pass, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit be1b649 into main Oct 29, 2026
110 of 116 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/mcp-share-refused-error-notice branch October 29, 2026 06:55
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 29, 2026
bolichen97 added a commit that referenced this pull request Oct 29, 2026
Backports parts 2-4 of the 0.11.0 insider list (#25665, #25666, #25667) onto
release/0.11.0. Parts 0-1 landed in e379f74 (#25663, #25664).

- fix(desktop): say why a pop-out cannot open instead of blaming the browser (#23922)
  (cherry picked from commit 99c2474)
- fix(crew): list a crewmate's own script and command schedules (#24023)
  (cherry picked from commit d2d8d14)
- fix(mcp-gateway): show a refused share outside Developer Mode (#23917)
  (cherry picked from commit c612613)
- fix(apps): negative-cache failed app.json fetches in the store listing (#23925)
  (cherry picked from commit 455e8ec)
- fix(power): say that Windows Modern Standby can still sleep on lock (#18259)
  (cherry picked from commit 0480058)
- fix(chat): show nothing in the transcript when the context cap trims (#24492)
  (cherry picked from commit 1411fcc)
- fix(frontend): seed settings rows from the served config during render (#24625)
  (cherry picked from commit e198b63)
- fix(schedule): keep the empty-folder chip rename open and return focus after it (#23904) (#24632)
  (cherry picked from commit 9f51b91)
- feat(website): swipe to dismiss the notification banner on mobile (#24674)
  (cherry picked from commit e4fad39)
- fix(agent): drop a gateway-inherited scratch temp before an agent spawn (#24645)
  (cherry picked from commit 1f28708)

- fix(dashboard): tell the crewmate about unresolved fields, draw no stale band (#24069)
  (cherry picked from commit f9d8e19)
- fix(mcp-gateway): never pool a credential vendor (#24672)
  (cherry picked from commit 2464225)
- fix(acp): keep MCP tools direct on KAS when the spec grants no tool_search (#24297)
  (cherry picked from commit ddc1fea)
- fix(crew): move a working icon avatar as one still image so it cannot tear (#24678)
  (cherry picked from commit e062153)
- fix(crew-mode): keep a crewmate's own chat on the conductor (#24894)
  (cherry picked from commit 7582829)
- fix(memory): name a damaged memory.db instead of restore advice (#24567)
  (cherry picked from commit efe7624)
- fix(env): search Builder Toolbox's Windows bin dir for agent binaries (#24563)
  (cherry picked from commit 686d39a)
- fix(discord): re-admit bot-opened threads after a gateway restart (#21776)
  (cherry picked from commit 072a37b)
- fix(web): keep a hidden model hidden after a harness switch respells its id (#24564)
  (cherry picked from commit 501f455)
- fix(gateway): say the gateway is running once boot finishes (#25029)
  (cherry picked from commit 02627ec)
- fix(mcp): say why an mcp.json settings file could not be read (#22169) (#24572)
  (cherry picked from commit ed75593)

- fix(mcp-gateway): render a refused share through ErrorNotice (#25660)
  (cherry picked from commit d895a90)
- fix(crew): write a crewmate's hidden welcome and check-ins in the user's language (#24966)
  (cherry picked from commit d5a76e6)
- feat(crew-mode): move every used crewmate to its conductor on upgrade (#24954)
  (cherry picked from commit 76e89ae)
- fix(hooks): Reads mode auto-approves Kiro Crew's own read-only MCP tools (#24910)
  (cherry picked from commit d8f2038)
- fix(members): list crewmates the person created, even with an empty chat (#24987)
  (cherry picked from commit 163652b)
- feat(cron): let a script cron feed its crewmate's Dashboard page (#24692)
  (cherry picked from commit 959b35a)
- fix(kas): honour a server's autoApprove through the derived permissions (#25106)
  (cherry picked from commit 073c83a)
- fix(chat): keep a scrolled-up reader still when a reprice clamps them (#24591)
  (cherry picked from commit 9a73292)
- fix(security): restore every allowed link on a host, not only identical ones (#20487)
  (cherry picked from commit b161144)
- fix(website): swipe the mobile notification banner up to dismiss it (#25151)
  (cherry picked from commit e68a716)
- test: carry the _card_outcomes helper #24910's tests read
  (cherry picked from commit 9df4d01)

The #24987 decision entry is new on this branch, so its Evidence lines
now link the owner restatement and the maintainer approval on #24987
instead of describing them. Main keeps its shipped (immutable) copy.
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.

2 participants