Skip to content

feat: let a person cancel an MCP elicitation from the card - #23973

Merged
bolichen97 merged 1 commit into
mainfrom
feat/elicitation-card-cancel
Nov 5, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/elicitation-card-cancel

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A person can put an MCP server's question away without answering it, which the server reads as MCP's cancel, not as a refusal.

The elicitation card offers Accept (Submit / I've finished) and Decline only. Someone who wants to dismiss the question without taking a position has to press Decline, and the MCP server reads that as an explicit no. Every layer under the card already accepts cancel (acp/client_elicitation.py's ELICITATION_ACTIONS, POST /api/chat/slots/{slot}/elicitation); today it is only ever sent on the person's behalf, by the approval timeout, a Stop, or the end of the turn.

Why it matters

MCP gives the person three answers for a reason: decline is "no", cancel is "I dismissed this". A server that branches on the two (retry later vs. abandon, record a refusal vs. record nothing) gets the wrong signal from every Kiro Crew user who just wanted the card out of the way, and Stop is the only other way out, which ends the whole turn.

Not a goal

  • No backend change: the route and the wire already take cancel.
  • No change to Accept / Decline, to the form, or to the URL ask.
  • No new timeout or auto-cancel behaviour.

What changed (motivation → approach → change)

Goal: hand the person the third answer. Approach: a muted text button, "Close without answering", on its own line under the Submit / Decline row, so its words are on the card before anyone clicks it and the action row keeps two peers (the max-two-buttons-per-row rule) (maintainer decision on review 5777767458: the earlier corner X was icon-only and its words lived only in the aria-label and tooltip). Change:

  • website/src/pages/chat/ElicitationCard.tsx: ElicitationAction type (accept | decline | cancel); answer() takes it; a line under the action row renders "Close without answering" (X icon + visible label, muted text, hover only lifts it to body text) while the ask is pending and not busy, posting action: "cancel" to the existing route and stamping the row through resolveByApprovalId, which the existing resolved_cancel ("Not answered") branch then draws. No tooltip, so nothing covers "This cannot be undone."
  • Catalog key pages.chat.elicitationCard.dismiss ("Close without answering") in all 12 languages, en-XA regenerated, and a translator-context entry in en.context.json describing it as a visible button label.
  • docs/system-specs/modules/acp-client.md: the MCP elicitation section names the three answers the card offers and why the cancel's label is visible text.

Backwards compatibility

Compatible: nothing is renamed, removed or rejected; a new control calls an existing route with a value it already accepts.

Removes nothing: the diff only adds a control, a catalog key and a spec paragraph.

Tests

  • ElicitationCard.test.tsx: new case — clicking "Close without answering" posts {request_id, request_mid, action: 'cancel'} and the store row resolves to cancel (so the dismiss can never be a decline in disguise). It also asserts the label is the button's own text content and that the button carries no aria-label, so it cannot regress to icon-only.
  • Existing case extended: a resolved row renders zero buttons, now explicitly including the dismiss.

Manual verification

Real card from the isolated capture entry website/capture/elicitation-card.html on a Vite dev server bound to 127.0.0.1, shot with Playwright: the pending form card dark + light, hovered, before (head 13f3b8d) and after this change, plus the "Not answered" row. On the after head the dismiss button's innerText reads "Close without answering" in both themes; on the before head it was empty.

Screenshots / video

Before (13f3b8d), dark: the dismiss is an icon-only X in the corner, and its hover tip covers "This cannot be undone.":

Before: icon-only X in the corner; its tooltip covers the end of the question

After, dark: "Close without answering" is a visible muted text button on its own line under Submit / Decline:

After: Submit and Decline, with a visible Close without answering line under them, dark

After, light, hovered: no tooltip, the question text stays readable:

After: Close without answering hovered in the light theme, no tooltip

After clicking it the row reads "Not answered", with no control left (unchanged from main):

Resolved row reading Not answered

Related Issues

Closes #23972

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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; see the Licensing section of CONTRIBUTING.md.

@CrysisDeu
CrysisDeu requested review from a team and KiroCrewCaptain as code owners October 25, 2026 08:13
@CrysisDeu
CrysisDeu requested a review from buluoray October 25, 2026 08:13
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 25, 2026
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

The UI reaches a cancel path the backend already accepts, the screenshots show the surface it adds, and nothing is taken away.

[DESIGN-REVIEWED] edfc3af

Description read

[DESCRIPTION-READ] 6039c320343a6cfa37aab957528c3b2d8ff40e43aad6cb30a8776981ee141add

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of edfc3af711565014474beaabcdfda5b23687e110 — 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. The new control sends an MCP answer the backend already accepts, and the card already has a way to show it.

Notes

  • Item 2 — undeclared/inherited: ElicitationAction has a doc comment stating that the server "reads the last two differently", but nothing in the diff checks how any server actually tells decline and cancel apart. Subtraction: shorten the comment to the type alone and keep the rationale only in acp-client.md.

What this change ships

Inventory (4 items) — 3 justified

Intent: let a person dismiss an MCP server's question without it being read as a refusal. ADDITION.

  1. The pending elicitation card shows a muted "Close without answering" button under Submit / Decline. Clicking it sends cancel, and the row then reads "Not answered". — justified
  2. A shared ElicitationAction type now covers the busy state and answer(), with a doc comment on MCP semantics. — undeclared, comment carries an unverified claim
  3. A new catalog key pages.chat.elicitationCard.dismiss in all 12 languages, plus translator context. — justified
  4. The acp-client spec now lists the three answers the card offers. — justified

[FIRST-PRINCIPLES-REVIEWED] edfc3af

Description read

[DESCRIPTION-READ] 24df6bad487b196680b8e56d6988b68381b90d36dc9bbff86205371898923fa1

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. The blind reader read "Close without answering" correctly ("closes the box without saying yes or no"). They hesitated but did not refuse to click it.

Notes

  • The blind reader "can't tell how 'Close without answering' differs from 'Decline'" and asked whether closing "leave[s] the question open". The label says what the card does but not what happens to the question. A wording like "Skip this question" would make it clear the question is put away, not left waiting.
  • The !resolved && !busy condition hides the dismiss line while Submit or Decline is pending. The card's height shrinks mid-action and then changes again when the resolved row replaces it. Keeping the line rendered but disabled while busy would stop that jump.
  • Shot-04 shows the resolved row the user lands on after Close without answering (this PR leaves it unchanged). The reader had "no idea" what "Confirm the deletion in your browser to continue" meant, and read the clock beside "Not answered" as still waiting. This card is now a result a person chooses, so its copy and icon should say "closed without an answer".

[UX-REVIEWED] edfc3af

Description read

[DESCRIPTION-READ] ed4ff28929e193354508efd78d90545f5823cae184f537ef807a6bd677cd6a75

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] edfc3af

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

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

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] edfc3af

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

@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 25, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/elicitation-card-cancel branch from fda1cd1 to fc6cd17 Compare October 25, 2026 09:19
@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 25, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Backend Tests shard 4 (Linux + Windows) fails on test_governance_policy_viewer.py::TestNoPolicyDefault::test_enterprise_unnamed_scope_reports_the_baseline, which reaches for the enterprise policy source over DNS. This PR touches no Python; the same shard is red on #23979, #23968, #23966 and #23964. Filed as #23986 (an interaction between #23686 and #23689, which merged four seconds apart). Nothing to fix here.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Backend Tests (3.12, 7) hit the known flake #23860 (test_an_unreadable_or_protected_checkout_keeps_its_variant, unraisable finaliser at teardown); green on #23979 and #23968 at the same base. Re-ran the failed jobs. Shard 4 stays red until #23986 lands.

@CrysisDeu
CrysisDeu force-pushed the feat/elicitation-card-cancel branch from fc6cd17 to 75e0458 Compare October 26, 2026 08:49
@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 26, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/elicitation-card-cancel branch from 75e0458 to 5012714 Compare October 26, 2026 08:59
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

UX Review blocker on 75e0458, addressed in 5012714: the X's name/tooltip now says what the server hears and how that differs from Decline — "Skip: the tool hears you didn't answer, not a no" (all 12 catalogs, context sidecar updated, hover screenshot in the description replaced).

Notes, not taken:

  • "Skipped by you" vs "Not answered": the row's resolved comes back from the gateway as the MCP action (cancel), the same word for a timeout, a Stop and the X — the server never learns who caused it, so after a reload the card cannot tell them apart either. A client-only label would show one wording before refresh and another after. Keeping the one honest label; a distinct cause would need the gateway to record it, which is new scope (Not a goal: no backend change).
  • Border looking dimmer in shot-02: .approval-glow is a 2.5 s pulse; the two shots caught different phases. Hovering the X changes nothing on the card (IconButton styles only itself).
  • Raw tool name in the header predates this PR.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

UX blockers on 5012714, addressed in 6438ff1: the X now reads "Skip without answering. Not a no: whoever asked decides what happens next." in all 12 catalogs (no 'tool', no 'hears'; it does not promise the action is or isn't taken, because that is the asking server's call). All four screenshots retaken on this build and the 'What changed' bullet now quotes the shipped string.

@CrysisDeu
CrysisDeu force-pushed the feat/elicitation-card-cancel branch from 5012714 to 6438ff1 Compare October 26, 2026 09:07
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

The UX lane's read of 6438ff1 saw the cropped hover shot (the tooltip is two lines and the capture clipped the first). Shot-02 and shot-04 were retaken with the whole tooltip in frame and swapped into the description after that run started; re-running the lane so it judges the real copy. The gold outline is a 2.5 s pulse, not a hover effect; the two shots caught different phases.

@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 26, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Owner decision (Zezhen): the X follows the convention every dialog's corner X already has — close without choosing — and its tooltip says exactly that, "Close without answering", in all 12 catalogs. It deliberately does not explain the protocol or predict what the asking server does next; no dialog's X does, and Kiro Crew cannot know. Decline is the control that says no. Screenshots retaken; the description quotes the shipped string.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 31, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/elicitation-card-cancel branch from 8d4faf7 to 13f3b8d Compare November 4, 2026 08:08
@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 4, 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.

Maintainer decision on the copy, so this stops going round: keep "Close without answering" and main's "Not answered" row. Those are fine. What the UX Review blocker is really about at 13f3b8d is that the control is icon-only. Its words live only in the aria-label and the tooltip, so a sighted reader never sees them before clicking.

Requesting one change:

  • Show the label as visible text on the card, for example a small text button "Close without answering" in the action row next to Submit / Decline, or the X with that text beside it. Use the same string you already have in all 12 catalogs, so no new translation is needed.
  • While you are there, place the tooltip (if you keep one) below or to the side so it does not cover "This cannot be undone."

The resolved-row wording and a distinct cancel cause stay out of scope, as you said. With a visible label and green CI I will approve.

@CrysisDeu
CrysisDeu force-pushed the feat/elicitation-card-cancel branch from 13f3b8d to 1ba7b35 Compare November 5, 2026 01:14
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

@bolichen97 Thanks. Addressed in 1ba7b35 (re review 5777767458):

  • The icon-only corner X is gone. "Close without answering" is now a small text button in the action row after Submit / Decline (X icon + visible label, same button style as its siblings), using the existing pages.chat.elicitationCard.dismiss string, so no new translation.
  • No tooltip anymore, so nothing covers "This cannot be undone."
  • "Close without answering" and main's "Not answered" row are unchanged.
  • The test now asserts the label is the button's own text and that it has no aria-label, so it cannot slip back to icon-only. Spec paragraph and translator context updated to match.

Before/after screenshots (dark, light, hovered, and the Not answered row) are in the PR body. Rebased onto current main; still one commit.

@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 5, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/elicitation-card-cancel branch from 1ba7b35 to f2467d5 Compare November 5, 2026 01:44
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

@bolichen97 Follow-up in f2467d5: Opus and GPT both blocked 1ba7b35 on the blocking max-two-buttons-per-row rule (a third peer button in the Submit / Decline row). So "Close without answering" now sits on its own line under that row, as a muted text button with the X icon. The label is still visible text, the copy and the "Not answered" row are unchanged, and there is no tooltip. Screenshots in the PR body are updated.

UX Review also asked for a wordier label ("Skip, don't decline"). I kept "Close without answering" per your decision on the copy. It did catch the hover fill making the button look like the suggested choice; the new button has no fill, and hover only lifts the text from muted to body color.

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

Copy link
Copy Markdown
Contributor

Maintainer decision on the UX Review blocker at f2467d5: the copy stays "Close without answering".

The real UX problem on earlier heads was that the control was icon-only, so a reader never saw its words. It is now visible text on its own line under Submit / Decline, in all 12 catalogs, and the test pins that the label is the button's own text. Further rewording ("Skip without saying no" and the like) has gone back and forth over several rounds. The card also cannot promise what the server does after a cancel, so it should not claim "nothing is approved". This decision closes the wording question for this PR.

@bolichen97

Copy link
Copy Markdown
Contributor

/ai-review override ux f2467d5 owner-decision: agent: maintainer decision keeps the visible label "Close without answering"; the icon-only control was the real issue and is fixed. Decision: #23973 (comment)

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a owner-decision release (class owner-decision) for the ux AI finding on f2467d549430937bd7b5f649f93c86237e7d4859.

agent: maintainer decision keeps the visible label "Close without answering"; the icon-only control was the real issue and is fixed. Decision: #23973 (comment)

This decision applies only to this commit. A new push requires a new judgment.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

CI note: Backend Tests (3.12, 7), Backend Tests (Windows) (7) and the Coverage Gate after them are red on the same three test/test_slack_code_channels_events.py tests that fail on main, tracked in #30095. This diff does not touch that path. I will rebase once #30095 is fixed on main.

@bolichen97

Copy link
Copy Markdown
Contributor

Could you update this branch onto main? The shard 7 failures (Backend Tests (3.12, 7), Backend Tests (Windows) (7) and the Coverage Gate that follows them) came from a regression in test/test_slack_code_channels_events.py on main, tracked in #30125. It is now fixed on main. The visible "Close without answering" label is what we asked for, and the UX lane is settled by the maintainer decision above. So once those shards are green, I will approve.

The elicitation card offered Accept and Decline only, so a person who
wanted to put the server's question away without taking a position had
to press Decline, which the server reads as an explicit no. The wire
and the slot route already accept MCP's third answer, `cancel`; only
the card withheld it.

An X in the card's corner now posts `cancel` through the same route and
stamps the row "Not answered". It is a corner dismiss rather than a
third button beside Decline: the action row holds two actions, and a
dismiss is not a sibling of yes / no. New catalog key
`pages.chat.elicitationCard.dismiss` in all 12 languages plus the
context sidecar; the resolved row still renders no control at all.

Closes #23972

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

This head only brings the branch onto main. The PR's own changes are identical to f2467d5: "Close without answering" is now visible text on its own line under Submit / Decline in all 12 catalogs, and the test pins that the label is the button's own text. That is the change I asked for, and it matches the maintainer decision on the wording above. Shard 7 is green now that the main regression is fixed, every lane passes after the rate-limited checks were re-run, and no regex is involved.

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.

feat: let a person cancel an MCP elicitation from the card (top-right X)

2 participants