Repository navigation
fix(mcp): say when kas cannot sign in to a server with its own client - #34749
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix is at mechanism level for both signals the user reported. One type field has no consumer. Notes
Inventory (7 items) — 5 justifiedIntent: a KAS user whose remote MCP server's own OAuth client never reaches the engine is told plainly that it can't sign in. FIX.
[FIRST-PRINCIPLES-REVIEWED] 51f02b0 Description read[DESCRIPTION-READ] 970bea6e2f96cadf2556026bae286ae2eb2fa86705837dc0d2e7f79a2a76b79a 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 flag is reused from the existing Notes
[DESIGN-REVIEWED] 51f02b0 Description read[DESCRIPTION-READ] fb2259f15bd2aacefca904a31dbb333197c3c682953f83dc9832c86240c67cc3 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) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the new chat-notice wording and the restyled probe-error row. shot-02 still shows the old "The kiro-cli backend supports it." line that this PR removes. Evidence gaps
Notes
[UX-REVIEWED] 51f02b0 Description read[DESCRIPTION-READ] b085d7de64af21436e519c95b478fca3e4df813345b3500f9c928e899d84493a 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 |
Opus 5.5 Review — ✅ human override acceptedReviewed Human judgment by @buluoray overrides the Opus 5.5 finding for [OPUS-OVERRIDE] 51f02b0 Verdict recorded from an authorized human decision 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: |
5a819d0 to
2ab177d
Compare
|
span=5ef05ce21ab4
|
|
span=bfe2ac771ba2
|
|
Goal line edited at the maintainer's explicit request: it no longer promises a harness-switch path. A stored Kiro CLI pick loads as KAS wherever kiro-cli offers its v3 engine ( |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 14% chance that this change introduces a defect, above the 12% limit for approving on its own. The PR keeps the KAS "sign-in won't work" chat notice in view: the notice is tagged meta.kind mcp_sign_in_unsupported, and TurnBlock.isAlwaysVisible exempts that kind from the fold. On KAS, an MCP row whose own oauth block is withheld (the existing oauth_withheld projection) now reads "Sign-in unavailable", with no Sign in control and no chat link. Connections providers and rows Crew holds the sign-in for are excluded. Removing the controls is safe: before this PR, such a row's sign-in already ran on kiro-cli (kas_sign_in_routes: an entry with an oauth block is not sent bare), and a KAS chat never reads that grant. The earlier GPT finding about a stale cached probe is fixed (the probe is read only while the config says kiro) and tested. oauthWithheld is sent as a flag only and never carries the secret. Python and frontend tests cover each branch. I found nothing that blocks. 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 |
2ab177d to
127819c
Compare
|
span=a4904cac2510
|
127819c to
80573fa
Compare
80573fa to
2033cf5
Compare
|
span=186547ba470e
|
|
span=ad870324449f
|
|
Not a goal edited at the maintainer's explicit request: removed the line saying the chat notice's words do not change. The notice now ends "will not work on this backend yet." instead of naming the kiro-cli backend (UX finding span=186547ba470e). Only that line changed. |
2033cf5 to
1d5c80f
Compare
1d5c80f to
454f66f
Compare
7f0b0e9 to
b856b00
Compare
|
Rebased onto main after #34643 landed (b856b00). That PR made Crew send a remote server's own The MCP Servers row now says Sign-in unavailable only when the block reaches no engine (
|
|
Edited the frozen Goal: line and the first |
b856b00 to
51f02b0
Compare
|
span=1dddaca9fe04
|
|
span=ad870324449f
|
|
Owner decision (Opus, span Reason: a person sets a Rebuttal with details: #34749 (comment) |
|
/ai-review override fable 51f02b0 owner-decision: Owner accepted the rare edge of a hand-set clientSecret on a server that also supports dynamic client registration; a set secret almost always means no registration (Slack, #34747). Decision: #34749 (comment) |
|
AI-review override not recorded: the handler could not load its command reader (a GitHub read failed, not your command). Re-issue the command. |
|
/ai-review override fable 51f02b0 owner-decision: Owner accepted the rare edge of a hand-set clientSecret on a server that also supports dynamic client registration; a set secret almost always means no registration (Slack, #34747). Decision: #34749 (comment) |
Human judgment recorded@buluoray recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
bolichen97
left a comment
There was a problem hiding this comment.
Approving 51f02b0. I read the whole diff, tests included.
- Message only; the OAuth flow is untouched. The PR reads main's existing
mcp_oauth_projection.oauth_withheldandoauth_servers_in(neither changes) to set a newoauthWithheldflag on the MCP row, and tags the existing session-start notice withmeta.kind: "mcp_sign_in_unsupported". What Crew sends to KAS, and how a sign-in runs, are the same as on main. The flag never carries the block itself, and the test checks aclientSecretdoes not leak into the row. - The row. On KAS (or a Kiro CLI pick that runs on KAS), a server whose block KAS never receives shows "Sign-in unavailable" and one sentence instead of the chat-sign-in guidance or a Sign in button, with no harness-switch link. A public client block, a server with no block, the Kiro CLI harness and a cached probe after a harness switch keep the normal guidance; each case is tested.
- The notice. The tagged row stays out of the collapsed steps (
isAlwaysVisible), and its wording drops the "kiro-cli backend supports it" line. A Python test pins the shared kind string between the two sides. - The 13 locales each add the same two keys.
No regex in product code. All 97 checks on this head are green.
Problem / Motivation
Goal: On the Kiro Agent engine, a person whose remote MCP server has its own OAuth settings that never reach the engine (a client secret) is told plainly, in the MCP Servers row and in the chat notice, that this server can't sign in yet; no harness-switch path is offered.
A user on Kiro Crew 0.12.1 with the Kiro Agent harness added a Slack MCP server with
"oauth": {"clientId": ...}. A KAS session never receives that block, so the server never connects. The user saw two wrong or hidden signals:Why it matters
Every Kiro Agent user with a remote server that needs its own OAuth client (Slack, and any other server with no dynamic client registration) loses that server with no visible reason, and the page sends them to a chat step that can never succeed.
Not a goal
dashboard.feature_previews.crew_oauth). They have their own sign-in path and keep it.What changed (motivation → approach → change)
Symptom → cause → change:
TurnBlockfolds every untagged row before the answer. The lost-oauthnotice was an untaggednoticerow. It now carriesmeta.kind: "mcp_sign_in_unsupported"(only when the lost keys include anoauthblock), andTurnBlock.isAlwaysVisiblekeeps that kind in view, the same way it keeps the agent greeting.oauthblock to KAS, except one that names aclientSecretor keeps nothing Crew sends (mcp_oauth_projection.oauth_withheld). The MCP row now carriesoauthWithheldfor that case: a new field onsrc/kiro_crew/mcp_discovery_server_info.py'sMcpServerInfo, set insrc/kiro_crew/mcp_discovery_config.py(_server_from_spec) andsrc/kiro_crew/mcp_discovery.py. It is a flag only, never the block. On KAS, such a row that is neither a Connections provider nor Crew-held reads Sign-in unavailable, with one plain line ("This server can't sign in with the Kiro Agent engine yet ..."). It offers no Sign in / Sign in again control, no Go to chat link and no hover tip, since none can finish there. A publicclientIdblock keeps the normal row. "On KAS" also covers a stored Kiro CLI pick that loads as KAS: the row reads thekiro_selection_runs_on_kasprobe, since the saved value still sayskiro. It offers no harness switch for the same reason (kiro_cli_pick_backend). The row cannot see the engine version, so an engine older than 0.66.104, which drops every block, is left to the chat notice (ashortcut:comment onkasCannotSignInsays so). A failed probe on such a row now shows its error throughErrorNotice, aserrors-use-error-noticerequires. The copy (sign_in_unsupported_on_kas,sign_in_unavailable) is inwebsite/src/i18n/locales/for all 12 locales.website/src/types/index.capabilities.tsdeclaresclientIdandoauthWithheldonMcpServer.spec_keys_notice(src/kiro_crew/agent_sdk/spec_hooks.py) now ends "will not work on this backend yet."docs/architecture/mcp.mdanddocs/guides/connecting-remote-oauth-mcp-server.mdsay the same.Backwards compatibility
Compatible: other harnesses, servers without their own client, Connections providers and Crew-held rows render as before; the notice row only gains a
meta.kind.Removes nothing: on KAS a row whose sign-in can never finish loses the Sign in / Sign in again control and chat link that could not work there; every other row keeps them.
Tests
test/test_mcp_sign_in_unsupported_notice.py: a lostoauthblock tags the notice; other lost keys keep the plain row;TurnBlock.isAlwaysVisiblenames the same kind string.test/test_kas_agents_mcp_oauth.py: the notice names the server and no longer names kiro-cli.test/test_mcp_sign_in_unsupported_notice.pyalso checks that the MCP row setsoauthWithheldfor aclientSecretblock and aclientMetadataUrl-only block, not for a publicclientIdblock or none, and never carries the secret.website/src/test/TurnBlock.mcpSignInUnsupported.test.tsx: the tagged notice stays visible in a collapsed turn; an untagged one still folds.website/src/test/McpTab.kasSignInUnsupported.test.tsx: on KAS a row withoauthWithheldshows the plain line and the Sign-in unavailable badge, with no link at all and no Sign in / Sign in again, also when a Kiro CLI grant is already held, and on a stored Kiro CLI pick that the probe says runs on KAS; a failed probe showsmcp-probe-error; an Outdated row keeps its tip. A row with only a publicclientId, a row without a client, and the Kiro CLI harness keep Sign-in required and the chat guidance.TurnBlockexemption turned the TurnBlock test and the parity test red; inverting the backend tag condition turned 2 of 3 Python tests red; makingkasCannotSignInreturn false turned 3 of 5 McpTab tests red; dropping the badge branch turned 2 of 5 red; dropping the held-grant branch turned 1 of 6 red; suppressing every tip on such a row turned the Outdated test red; keying the row onclientIdinstead ofoauthWithheldturned 6 of 9 McpTab tests red; never settingoauthWithheldin_server_from_specturned the row test red; dropping thekiro_selection_runs_on_kascheck turned its test red; dropping the probe-error test id turned its assertion red.test_kas_engine_features.py,test_agent_welcome_message.py,test_crew_fired_spec_hooks.py,test_flake_pattern_ratchet.py(263 passed);McpTab.test.tsx,McpTab.kasChatNote.test.tsx,src/i18n/(81 files, 1286 passed);i18n:check,tsc -p tsconfig.app.json, eslint, flake8, mypy, black, isort, docs-lint.Proof: not provable -- other: reverting the production hunks deletes the constant the new test imports, so prove.py only errors at collection; the manual mutations above stand in.
Manual verification
Rendered the built SPA with stubbed APIs:
clientIdand one without: the first reads Sign-in unavailable with the plain line; the other keeps Sign-in required and the chat guidance.Not run against a live KAS session. (The "Couldn't load your starred bots" toast in the chat shots is the stub's missing fixture, not this change.)
Screenshots / video
MCP Servers row, after:
Chat, a finished collapsed turn. Tagged notice (this PR), visible above the answer:
Same turn with an untagged notice (before): it folds into the steps
Related Issues
Closes #34747
Closes #34770
Merge order: rebased on #34643, which this builds on: the row flags only the blocks that #34643 still withholds.
Sibling sweep
Swept:
git grep -n "kiro-cli backend supports\|Agent Harness" -- src/kiro_crew website/src/pages/overviewandgit grep -n "sign_in_required_help\|McpRowSignIn" -- website/srcSibling: website/src/pages/overview/McpTab.tsx -- changed here
Sibling: src/kiro_crew/dashboard/chat_turn/turn_spec_hooks.py -- changed here
Sibling: src/kiro_crew/agent_sdk/spec_hooks.py -- changed here
Sibling: src/kiro_crew/mcp_oauth_projection.py -- not affected -- #34643 removed
withhold_oauth, the log line this PR had editedSibling: src/kiro_crew/cron_service/turn_hooks.py -- not affected -- cron runs have no dashboard turn fold
Pattern harvest
Not generalizable: the fold exemption is an explicit per-kind list by design, and each kind that must stay visible is added on purpose.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)