fix(ask-user): gate a partial answer to a multi-question required call

SU
12d ago
+260-14

Fixes #2966.

Gap 1 — partial answer to a required multi-question call

formatBody only took the gated branch for settlements other than answered/comment-submitted, so a required call that settled as answered with some questions still in unanswered read as an ordinary partial answer ("Unanswered: ...") with no instruction to hold the gated action. Now a required call with any unanswered question renders the refusal ("The user answered only part of the question." + the answered lines + "Unanswered: ..." + "No answer: do not take the action it gates. ..."). A fully answered required call is unchanged, and non-required partial answers render exactly as before.

Gap 2 — restart pass-through test

settleUnrestorable already carries required onto the orphaned request, but nothing tested it. Added a resume test: a required call whose recorded arguments can no longer form a valid request (zero questions) is resumed and the delivered frame is asserted to contain the refusal and not "continue on best judgment". The test fails if the pass-through is removed (verified by mutation).

Tests

  • New test/suite/regressions/2966-ask-user-required-partial-gate.test.ts: RED before the fix (2 failed), GREEN after (4 passed).
  • New resume test in test/suite/ask-user-resume.test.ts: 16 passed; mutation check (pass-through removed) fails with the old "continue on best judgment" text.
  • Neighbouring suites (2949-required-question-gate, ask-user cancel suites): passed.
  • bun run check (lint + fmt + tsc + gates): clean.

Notes

  • CLA: pending user signature (per sprint note; not signed by the contributor).
  • Change fragment (changes/unreleased/<pr-number>.md, tracker + changelog blocks) to follow once the PR number is assigned.

Summary by cubic

Fixes #2966. A required multi-question ask-user call that settles as answered or comment-submitted with some questions unanswered now refuses the gated action and names the unanswered questions, instead of reading as an ordinary partial answer with no instruction to hold the action. Fully answered required calls and non-required partial renderings are unchanged.

Also handles the comment-only reply to a required question: it stays gated, keeps the user's comment in the rendering and in the model's words, and its reason line says the question went unanswered instead of claiming a partial answer. A partial gated rendering now ends with a partial-specific closing line that names the still-gating question, rather than the contradictory No answer: line.

  • Adjusts formatBody and formatGatedNoAnswer in packages/coding-agent/src/core/extensions/builtin/ask-user/format.ts to gate required partial answers.
  • Adds a resume test verifying that a required call that cannot be restored still refuses on resume, plus regression tests for the refusal, the comment-only case, and the unchanged non-required output.
  • Adds a changelog fragment under changes/unreleased/6283.md.