Repository navigation
fix(kas): show the withheld-env notice only when the user can fix it - #30719
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The notice is narrowed to servers the user can fix, which the reported defect asks for, and the "would Share fix it" test reuses the gateway's own Notes
What this change shipsInventory (7 items) — 6 justifiedIntent: a KAS user starting a chat sees a withheld-env notice only when they can act on it, as one line pointing to a UI place. FIX.
[FIRST-PRINCIPLES-REVIEWED] c8aa820 Description read[DESCRIPTION-READ] 0f8a51fd71524eab58e60b4ba9a5ec30ef97468768bc3f4208650dbeb19c3576 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS The notice now only names servers Share can fix, and points to a real UI place. It can be walked back with a revert. Notes
[DESIGN-REVIEWED] c8aa820 Description read[DESCRIPTION-READ] 2ba052eea1c9d17f549f4d0e7c145ed263eddc25e71c2f48e93d9694423afb45 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] c8aa820 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
2d923db to
87229a7
Compare
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: |
87229a7 to
7f09997
Compare
|
Disposition for the findings on GPT 6.1 F1 ( Design Review blocker (Share alone vs a credential) — fixed by the same change. One correction to its trigger: First Principles item 1 ( First Principles item 4 ( builder-security checked: no new listener, route or auth change; the edit is notice text. |
7f09997 to
c9a78e1
Compare
c9a78e1 to
09c038f
Compare
09c038f to
8678738
Compare
|
Disposition for findings on GPT 6.1 F1 ( First Principles note (path relay overlaps #30643) — kept, owner decision. Advisory on this head (PASS). The owner asked for plainly non-credential env to stop being withheld or named, whatever path builds the batch. Design notes (forwarding off; builder-security checked: no listener, route or auth change; the edit moves values from the wire entry into the owner-only local snapshot, so less crosses the wire than before. |
8678738 to
22b7805
Compare
|
Disposition for findings on GPT 6.1 F1 ( Backend Tests (Windows) (2), |
22b7805 to
a548c9f
Compare
|
Notes on Owner rule (no config terms in user-facing text) — applied. The notice now reads "ℹ may be missing some of its settings in this chat. To fix it, turn on Share for it in Customize → Connections → MCP Management." It shows only when Share alone fixes it (the rewriter's own Opus 5.5 on Design notes on First Principles notes on |
a548c9f to
02d2f53
Compare
|
Disposition for findings on GPT 6.1 F1 ( |
02d2f53 to
9282af9
Compare
On KAS a new chat listed every MCP server that lost an env value on the wire, with key names and a vault and secret:// recipe. Users saw the settings of servers the edition ships, none of which they can change. The notice is now one line with no config terms. It names only a local server Crew and the edition do not ship, only when turning on Share in MCP Management would give it its full env (the rewriter's own count of withheld keys), and points there. Everything else stays in the log.
9282af9 to
c8aa820
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approving c8aa820 as maintainer. All 97 checks pass.
What I checked:
- Only the chat notice changes. What the KAS projection withholds is untouched, and every withheld server keeps its INFO log line, so nothing is lost for debugging.
_share_noticenames a server only when it is stdio, lostenv, is not Crew- or edition-shipped (crew_owned_mcp_servers()), and_share_withholdssays Share alone would carry every lost key. That last check reuses the rewriter's own_withheld_env_countwith the same forwarding setting and pool-identity keys, so the notice cannot promise a fix the gateway would not make. No key names (a malformed env) counts as "Share would not fix it".- The line names servers only. Each name still passes
_loggable_key_names, and a credential-shaped name is counted as "N more", never printed. No key, value,secret://recipe or CLI command reaches the chat, and the tests pin each of these. - The not-run notice (registry mode, insecure url) is kept as its own part beside the Share line.
Auto-merge is already set by the author, so I am not setting it.
…30719) On KAS a new chat listed every MCP server that lost an env value on the wire, with key names and a vault and secret:// recipe. Users saw the settings of servers the edition ships, none of which they can change. The notice is now one line with no config terms. It names only a local server Crew and the edition do not ship, only when turning on Share in MCP Management would give it its full env (the rewriter's own count of withheld keys), and points there. Everything else stays in the log. (cherry picked from commit 77606ac)
…30719) On KAS a new chat listed every MCP server that lost an env value on the wire, with key names and a vault and secret:// recipe. Users saw the settings of servers the edition ships, none of which they can change. The notice is now one line with no config terms. It names only a local server Crew and the edition do not ship, only when turning on Share in MCP Management would give it its full env (the rewriter's own count of withheld keys), and points there. Everything else stays in the log. (cherry picked from commit 77606ac)
Problem / Motivation
Goal: On the KAS backend, a new chat shows the withheld-env notice only for a server the user can fix, as one line that points to a place in the UI.
A user on KAS saw this at session start, for a server whose env sets
PATHand for two edition-shipped stdio servers:None of it is actionable:
PATHis not a secret, the edition's servers are not the user's to configure, the recipe is several steps, and MCP Management is no longer under Developer.Why it matters
Every KAS user with a common MCP setup (a
PATHor a directory inenv) gets a scary multi-paragraph notice at the start of every chat, about things they cannot change. It reads like Crew is broken.Not a goal
What changed (motivation → approach → change)
Symptom: a multi-line notice naming key names, edition servers and a vault recipe. Causes and changes, all in
acp/kas_withheld_notice.py:crew_owned_mcp_servers()(Crew's managed servers plus the edition'sextra_mcp_servers()), read throughkiro_crew.agent.env, nosecret://, no CLI): "ℹ may be missing some of its settings in this chat. To fix it, turn on Share for it in Customize → Connections → MCP Management." It shows only for a local (command) server that lost env, and only when Share alone fixes it: the rewriter's ownrewriter_env._withheld_env_count, with the current forwarding setting and pool-identity keys, must be zero for the lost keys. A server Share would not fix, forwarding off, a malformed env, and a remote server nothing can supply (ansseone) stay in the log; the projection's existing INFO log line still names each, so a server that fails still has a visible cause.Docs:
agent-spec-fields.mdnotice sentence updated.builder-security checked: the change opens no listener, port, route or upload, does not touch auth, and changes nothing that crosses the ACP wire; it only changes a display string and when it is shown.
Backwards compatibility
Compatible: only the notice text and when it appears change; nothing accepted today is refused.
Removes nothing: no key, path, record or function is removed; the notice is a display string read only by the chat row.
Tests
Proof: PROVEN test/test_kas_withheld_credentials_notice.py::TestTheNotice::test_it_is_one_line_naming_the_server_and_the_ui_place, test/test_kas_withheld_credentials_notice.py::TestTheNotice::test_a_server_share_would_not_fix_is_left_to_the_log[AWS_SECRET_ACCESS_KEY], test/test_kas_withheld_credentials_notice.py::TestTheNotice::test_a_server_share_would_not_fix_is_left_to_the_log[AWS_ACCESS_KEY_ID], test/test_kas_withheld_credentials_notice.py::TestTheNotice::test_a_server_share_would_not_fix_is_left_to_the_log[AWS_SESSION_TOKEN], test/test_kas_withheld_credentials_notice.py::TestTheNotice::test_env_share_forwards_gets_share_alone[GITLAB_API_URL] (head 02d2f53)
test_kas_withheld_credentials_notice.py: a keyed session built through the real KAS harness names no stdio server and launches it through the local launcher; the exact one-line text; a key the gateway will not forward to a shared server (AWS secret, access and session keys), forwarding off, or a malformed env shows nothing; a key it forwards (GITHUB_TOKEN,GITLAB_API_URL) shows the Share line, each checked against_withheld_env_count; no key,env,secret://, CLI command or newline in the text; ansseserver gives no notice; Crew's and the edition's servers are never named; a credential-shaped server name is counted.Manual verification
Ran
test_kas_withheld_credentials_notice.py,test_kas_agents_mcp_env_relay.py,test_kas_env_launch.py,test_facade_mirror_guards.pyandtest_agent_refactor_facade.py, one process: all pass. black, isort, flake8, mypy, comment-history, brand, line cap, harness parity, docs lint pass.Before (user's report, names generalized): see Problem. After, for a non-edition local server that still lost env:
For the reported setup: the edition's servers are never named; a session with a key names nothing, because the launcher carries every stdio value. A server whose env sets
PATHis named only in a session with no key (the case #30643 fixes), and Share fixes it.Related Issues
Related: #30643 (carries env for keyless sessions, the root cause of the report). Both edit
kas_withheld_notice.py; whichever merges second rebases. #30643's new "will not run" section adds akirocrew config setcommand to the notice, which this PR's no-CLI rule would also cover once both land.Overlap check: #26786 (merged) added the notice this narrows.
Sibling sweep
Swept: git grep -n "withheld_credentials_notice(" -- src/
Sibling: src/kiro_crew/acp/kas_agents.py -- not affected -- only collects what was withheld; the notice decides what to show
Sibling: src/kiro_crew/acp/harness/kas.py -- not affected -- only calls the notice function and passes its string through
Pattern harvest
Rule candidate: review-prompt
Pattern: user-facing remediation text that names config keys, secrets recipes or CLI commands the user cannot act on
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.