Skip to content

fix(acp): answer KAS user-input questions instead of letting Deny read as yes - #30195

Merged
kyleseaman merged 1 commit into
mainfrom
fix/kas-user-input-p0-19
Nov 5, 2026
Merged

kyleseaman merged 1 commit into
mainfrom
fix/kas-user-input-p0-19

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On KAS, when the model asks the user a question, a Deny (or no person at all) never reaches the model as "yes".

Kiro Crew does not declare _meta.kiro.userInput to KAS. KAS then asks through session/request_permission; a Deny with no reject option answers cancelled, KAS maps it to next-phase, and its user_input tool tells the model to read that as agreement. Cron, channel and sub-agent turns take the same path.

Why it matters

Every KAS user who answers "no" to the model's question gets the opposite. This is row P0-19 of the kiro-cli to KAS migration: kiro-cli users moving to KAS lose a working "no".

Not a goal

  • Changing KAS (kiro-agent) code.
  • Drawing KAS sub-options; the answer is the chosen option's title.
  • Path-scoped approval choices (P1-25) and the remaining approval-card rows (P1-26).

What changed (motivation → approach → change)

Symptom: Deny reads as yes. Root cause: no userInput capability, and KAS reads every _kiro/userInput reply other than answered with a non-empty answer (its dismissed and errors included) as "move on". So declaring the flag alone would not help; the flag and the handler ship together.

Approach: _kiro/userInput rides the existing MCP elicitation path (same classifier action, card, pending registry, Stop/turn-boundary/stranded cancel paths), as a form: an optional choice of the offered titles and a free-text answer (required when no option is offered). Reusing the path gives the card, reload of the card row, and every "nobody answered" exit for free, instead of a second copy of each.

Change: acp/types.py declares userInput: true. acp/elicitation.py parses the request and adds elicitation_reply / user_input_response, which every driver now answers through; the request's method alone picks the reply shape, and answer_elicitation takes person=False for a caller that showed the ask to nobody. For a user-input request the reply is always {"action": "answered", "answer": <text>}: the choice, the typed text, or choice: text; a person's Deny sends text saying they declined and it is not agreement; every exit with no person (no consumer can ask, unrenderable, a card the dashboard refuses for a tainted value, text-only path, turn boundary, stranded, trust sweep, window expired, Stop) sends text saying nobody could answer. MCP elicitation replies are unchanged. KAS replays a pending question on session/load only as a history row and does not re-send _kiro/userInput after a restart, so there is nothing for Crew to re-answer. The ACP client spec documents the third wire.

Backwards compatibility

Compatible: MCP elicitation keeps its accept/decline/cancel replies; the only new wire is a KAS request Crew never received before.

Removes nothing: adds one capability and one handled method; no path, key or validator is taken away.

Tests

  • test/test_acp_user_input.py: flag declared on KAS only; both classifiers route the method; parse of options, string options, duplicates and refusals; the card row validating an answer as the driver does; every reply action yields answered with text; session handle and single-session client paths for accept, Deny, no person, unrenderable, text-only and turn-boundary cancel.
  • test/test_dashboard_elicitation.py: a real session handle behind the dashboard card for choice, Deny, reject, trust sweeps, Stop and a tainted option; each puts answered with text on the wire.
  • Binding signature hashes for answer_elicitation updated in test/test_acp_bindings.py, test/test_client_bindings.py, test/test_session_handle_bindings.py.
  • Capability expectations updated in test/test_acp_harness_contract.py and test/test_acp_harness_wire_parity.py.

Proof: not provable -- other: prove.py stops at BASELINE_RED from copilot tests that fail on main in this environment; with src/ reverted to origin/main the new tests fail (7 failed, 1 error).

Manual verification

N/A — unit coverage sufficient: the wire shapes are taken from the KAS source (acp/acp-event-adapter.ts handleUserInputViaCapability) and driven end to end through the handle and the card.

Related Issues

Closes #30194

Sibling sweep

Swept: git grep -n "elicitation_response(" -- src/
Sibling: src/kiro_crew/acp/session_handle_turn.py -- changed here
Sibling: src/kiro_crew/acp/client_elicitation.py -- changed here
Sibling: src/kiro_crew/acp/session_handle_elicitation.py -- changed here

Pattern harvest

Not generalizable: the defect is KAS's specific mapping of every non-answered reply to "next phase", handled once in the reply builder.

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.

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 5, 2026 05:36
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 1d894de0f61eee2d18283cc49ffb36e0919c2098 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 Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

No design-level concerns. Declaring the capability and adding the handler in one change, and building every reply from the request's method, closes the case where a Deny reads as yes at every exit. The MCP elicitation reply shapes stay the same.

Notes

  • When a field is invalid, the fallback at elicitation_prompt.py:238 still sends the default person=True, so the model is told "the user declined" when no person declined. The text still says it is not agreement, so this is a wording issue and not a wrong answer.

[DESIGN-REVIEWED] 1d894de

Description read

[DESCRIPTION-READ] 3d5d2d56d9092feb446735c27089c6638a2ade460fc8a076429aeb36fba971c6

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 Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 1d894de0f61eee2d18283cc49ffb36e0919c2098 — 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 fix declares userInput together with a handler for it, which is the root cause, so nothing blocks. One note: the person flag adds surface that the Goal doesn't need.

Notes

  • Item 4 — oversized: the Goal is that "a Deny (or no person at all) never reaches the model as 'yes'", and one "not agreement" text already does that. Splitting it into USER_INPUT_DECLINED_ANSWER and USER_INPUT_NO_PERSON_ANSWER adds a person: bool = True keyword to answer_elicitation on four signatures (client_elicitation.py, session_handle_elicitation.py, session_provider.py, providers/acp.py), and changes three binding hashes. Only two call sites pass that keyword, both person=False in elicitation_prompt.py. The other person=False sites call elicitation_reply directly.
    Subtraction: merge the two texts into one constant and delete the person parameter from answer_elicitation, _answer_payload, user_input_response and elicitation_reply.
    Clears when: the mechanism is removed, or a human amends the Goal.

What this change ships

Inventory (6 items) — 5 justified

Intent: on KAS, when someone says "no" to the model's question, or nobody is there to answer, the model never reads it as "yes". This is a FIX (closes #30194).

  1. KAS now sends the model's questions to Crew as _kiro/userInput instead of a permission request (the userInput capability is declared) — justified
  2. The model's question appears on the existing elicitation card, with the offered choices plus a free-text answer — justified
  3. Deny, Stop, a turn boundary, a stranded request and every other no-person exit now reply answered with "not agreement" text — justified
  4. The model gets different text for "the user declined" and "nobody could answer" — oversized
  5. The ACP client spec gains a paragraph on the _kiro/userInput wire — justified
  6. The KAS capability pin test is rewritten to include userInput — justified (the old pin's own reason, "a request with no handler", no longer applies because the handler ships in this change)

[FIRST-PRINCIPLES-REVIEWED] 1d894de

Description read

[DESCRIPTION-READ] 90d79d3e3103d19267dccc186fb529932060953060f5322afbade8d4a7f75423

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 Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 1d894de

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

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

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1d894de

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 1d894de0f61eee2d18283cc49ffb36e0919c2098 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 Nov 5, 2026
@iamwhatever
iamwhatever force-pushed the fix/kas-user-input-p0-19 branch from 82b2bc3 to 1d894de Compare November 5, 2026 06:17
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 5, 2026
@kyleseaman
kyleseaman merged commit bbf4e6d into main Nov 5, 2026
155 of 165 checks passed
@kyleseaman
kyleseaman deleted the fix/kas-user-input-p0-19 branch November 5, 2026 16:22
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 5, 2026
buluoray added a commit that referenced this pull request Nov 5, 2026
Cherry-picked with -x from main onto release/0.12.0 for 0.12.1, in
main merge order. Every pick applied clean.

- #29990 fix(approvals): resolve an approval by id only in the session it was shown in
  (cherry picked from commit 4d2b8a5)
- #30129 fix(session): don't resume in an earlier process's hidden scratch dir
  (cherry picked from commit 599e33e)
- #30205 fix(acp): let Crew's MCP servers defer on the KAS engine bundle
  (cherry picked from commit 3d4e4a6)
- #30279 fix: keep one more credential value out of log output
  (cherry picked from commit 9fcf80f)
- #30195 fix(acp): answer KAS user-input questions instead of letting Deny read as yes
  (cherry picked from commit bbf4e6d)
- #30199 fix: redact four log lines and tighten two small checks
  (cherry picked from commit 16ff876)

Co-authored-by: Bolin Chen <17506219+bolichen97@users.noreply.github.com>
Co-authored-by: Joe Guo <12429733+iamwhatever@users.noreply.github.com>
buluoray added a commit that referenced this pull request Nov 6, 2026
Cherry-picked with -x from main onto release/0.12.0 for 0.12.1, in
main merge order. Every pick applied clean.

- #29990 fix(approvals): resolve an approval by id only in the session it was shown in
  (cherry picked from commit 4d2b8a5)
- #30129 fix(session): don't resume in an earlier process's hidden scratch dir
  (cherry picked from commit 599e33e)
- #30205 fix(acp): let Crew's MCP servers defer on the KAS engine bundle
  (cherry picked from commit 3d4e4a6)
- #30279 fix: keep one more credential value out of log output
  (cherry picked from commit 9fcf80f)
- #30195 fix(acp): answer KAS user-input questions instead of letting Deny read as yes
  (cherry picked from commit bbf4e6d)
- #30199 fix: redact four log lines and tighten two small checks
  (cherry picked from commit 16ff876)

Co-authored-by: Bolin Chen <17506219+bolichen97@users.noreply.github.com>
Co-authored-by: Joe Guo <12429733+iamwhatever@users.noreply.github.com>
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.

KAS: a Deny on the model's question reaches the model as yes

2 participants