Skip to content

feat(session-ui): surface declined settings-seed share as a notice row - #20651

Merged
bolichen97 merged 1 commit into
mainfrom
feat/seed-declined-notice
Oct 23, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/seed-declined-notice

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Surface the declined settings-seed share in the session UI so a user whose sibling session governs the settings file can see why MCP tools are missing and what to do.

When a sibling session's settings.local.json differs from this session's (model or permissions differ), the seed path declines the share and _log_declined_share fires. The session starts without Crew's MCP tools and there is no user-visible explanation — only a gateway log line.

Why it matters

Without a notice, a user sees a session with no MCP tools and no reason. They cannot tell whether Kiro Crew is broken, whether the agent has no tools configured, or whether a sibling session is blocking the seed. The missing explanation has caused confusion and unnecessary debugging.

Not a goal

  • Changing the decline rule itself (the governed-surface security boundary).
  • Fixing the model-substitution retry failure when a sharer holds the seed (a separate architectural issue noted in the issue).
  • Surfacing the specific setting value that differs (only the field type is named, never a value).

What changed (motivation → approach → change)

A new claude session whose tools are held back now gets one info row in Sessions that says so, names whose file holds the path, and says what to do.

cause row says
another open Crew session's seed tools are off; another open Crew session in this folder uses a different model or permission mode; close it, then start a new session here
the project's own file tools are off; this folder's own .claude/settings.local.json controls tool approvals; the gateway log names the reason
governed, no file, or not claude no row

The row reads the same live state that withholds the tools, so it cannot drift from it. AcpClient.settings_withheld_cause() (in acp/client_seed_ownership.py) returns "" whenever _permission_surface_governed holds or the backend seeds no file; otherwise it reads the file's durable record to tell a Crew seed from a project file. Every decline path and a later re-earn are covered with no extra flag. LLMProvider.settings_withheld_cause() (providers/base.py) defaults to ""; AcpProvider (providers/acp.py) forwards it from a raw AcpClient.

_notice_seed_declined in dashboard/chat_turn/turn_spec_hooks.py runs the read off the event loop once on a new session (called from turn_admission.py) and appends a notice row tagged SEED_DECLINED_NOTICE_KIND (chat_utils_injected_rows.py). A failed read draws nothing. The crewmate chat already drops every notice row, so no frontend file changes.

Backwards compatibility

Compatible: adds one AcpClient method plus a helper split out of _foreign_settings_owner (same answer), one provider method with a "" default, one notice kind, and one new transcript row. Nothing that works today changes.

Removes nothing: the diff only adds a read and a row.

Tests

test/test_settings_seed_declined_notice.py (20 tests):

  • TestSettingsWithheldCause — real AcpClients on one tmp_path: "" for a kiro client, no file, own seed, identical sibling seed; "session" for a sibling seed with another model or permission mode; "project" for a project-owned file the session cannot leave out; the answer clears when the share is re-earned.
  • TestProviderForwards — the provider forwards a string answer and reads any other shape as "".
  • TestNoticeEmitted — one tagged row with the right text per cause; no row for "", an unknown answer, a client without the read, or a read that raises; a real withheld client gets one row. These fail on main, where _notice_seed_declined does not exist.

test/test_client_bindings.py, test/test_acp_bindings.py and the chat_utils facade inventory list the new names.

Manual verification

N/A — unit coverage sufficient: the cause is computed from real AcpClient seed writes on disk, and the row goes through the same append_and_surface path as the existing session-start notices.

Screenshots / video

No frontend file changes. The row draws as the existing info notice card used by the other session-start notices.

Related Issues

Fixes #12989

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

Contributions are accepted under the project's Apache-2.0 license.

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

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision d54e74d47da4940207d14f29045978f0543a8085 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of d54e74d47da4940207d14f29045978f0543a8085 — 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. Two pieces of new surface have no reader: the row's meta.kind tag and the two cause constants.

Notes

  • Item 3 — zero consumers: meta={"kind": SEED_DECLINED_NOTICE_KIND} is written to every row, but I grepped SEED_DECLINED_NOTICE_KIND|seed_declined across src/ and website/src/ and found 0 readers outside tests. The crewmate chat already drops every notice whatever its kind. Subtraction: remove SEED_DECLINED_NOTICE_KIND and its re-exports in chat_runner.py, chat_utils.py and the facade inventory, and append the row without the meta tag, as _notice_steer_upgrade already does.
  • Item 4 — zero consumers: SETTINGS_WITHHELD_BY_SESSION and SETTINGS_WITHHELD_BY_PROJECT have 0 uses outside client_seed_ownership.py. _SEED_DECLINED_NOTICES keys on the plain strings "session" and "project" instead, so the same values are spelled two ways. Subtraction: delete the two constants and return the plain strings.

What this change ships

Inventory (5 items) — 3 justified

Intent: let a user see why a new claude session has no Crew MCP tools, and what to do about it (#12989). ADDITION.

  1. A new session whose tools are withheld by another open Crew session's seed shows an info row naming that session and the fix — justified
  2. A new session whose tools are withheld by the project's own settings.local.json shows an info row naming that file — justified
  3. Each such row carries a new transcript meta.kind value, seed_declined — zero consumers
  4. The client and provider expose a new read, settings_withheld_cause, plus two exported cause constants — zero consumers (constants); the read itself has one reader, the notice
  5. _foreign_settings_owner now delegates to the split-out helper _foreign_settings_is_crew_seed and gives the same answer — justified

[FIRST-PRINCIPLES-REVIEWED] d54e74d

Description read

[DESCRIPTION-READ] 1fe30c4f107356222173ec7159d259d60e1778e84a3b60b00e09c5b03a2bcfea

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

No design-level concerns. The row reads the same governed predicate that withholds the mcpServers array, and the claude backend is named positively through ACP_BACKENDS_SEED_LOCAL_SETTINGS.

Notes

  • The check runs once, at is_new admission. If the share is earned back later, or a sibling session declines it after start, the existing row stays as it is and no new row appears. Nothing goes wrong because of this, but the docstring should say the row describes the session's state at start.

[DESIGN-REVIEWED] d54e74d

Description read

[DESCRIPTION-READ] d8ddb7c31cec5cf0a6b452e53b1a79cb1939e494600c676c43839b0b0f58b8ca

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] d54e74d

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable d54e74d47da4940207d14f29045978f0543a8085: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d54e74d

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d54e74d47da4940207d14f29045978f0543a8085: <one-sentence reason>

@CrysisDeu
CrysisDeu force-pushed the feat/seed-declined-notice branch from df1cc0f to a8b80fe Compare October 15, 2026 06:44
@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 Oct 15, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/seed-declined-notice branch from a8b80fe to 62761a2 Compare October 15, 2026 07:21
@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 Oct 15, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/seed-declined-notice branch from 62761a2 to 7008866 Compare October 15, 2026 07:37
@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 Oct 15, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/seed-declined-notice branch from 7008866 to 95157e5 Compare October 15, 2026 08:22
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision labels Oct 15, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

This PR now conflicts with main. Main moved the runner turn helpers into chat_turn in #21086. Please rebase onto current main and move the changed hunks to their new location. A full review runs automatically after you push.

Checked: head 95157e5 is open and GitHub reports it as conflicting with main.

A new claude session whose MCP tools are withheld because a settings file Crew does not govern holds .claude/settings.local.json gets one info notice naming whose file it is (another open Crew session's seed, or the project's own file) and what to do.

The row reads AcpClient.settings_withheld_cause(), which answers from the live _permission_surface_governed state that withholds the array, so every decline path and a later re-earn are covered with no extra flag.

Fixes #12989
@iamwhatever
iamwhatever force-pushed the feat/seed-declined-notice branch from 95157e5 to d54e74d Compare October 23, 2026 05:06
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 23, 2026

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

Approving head d54e74d.

The rebase resolves the earlier merge conflict, and this revision fixes every point from the first round:

  1. The notice helper now lives in chat_turn/turn_spec_hooks.py beside its siblings, and turn_admission.py calls it on a new session.
  2. The row reads the live governed state (_seeds_local_settings and not _permission_surface_governed). The claude mirror reads the same flag to withhold the mcpServers array, so the row cannot drift from the tools. The old one-way latch is gone, so the held-by-sibling branch and a later re-earn are covered.
  3. The project-owned file path now gets its own text and no longer tells the user to close a session.
  4. The crewmate chat edits are dropped. Main already drops every notice row there.
  5. The committed screenshots are gone, and no frontend file changes.

What I verified on this head:

  • The 20 new tests and the binding tests pass locally (550 passed). The new test file fails on main (20 failed), so it guards the behaviour.
  • git merge-tree against current main reports no conflict.
  • The row text is a constant. It names no model id, permission mode, path or other session.
  • No file is on the security path list. The linked issue is tier T2. Every required check is green and the label is readiness: passed. The Design, First Principles, Opus and GPT lanes pass on this head.

Optional follow up, not blocking: the First Principles lane notes that the cause constants and the notice table spell the same values twice. Importing the constants in _SEED_DECLINED_NOTICES would keep them in one place.

@bolichen97
bolichen97 merged commit a63ed29 into main Oct 23, 2026
107 checks passed
@bolichen97
bolichen97 deleted the feat/seed-declined-notice branch October 23, 2026 06:18
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 23, 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.

Surface the declined settings-seed share in the session UI

2 participants