Repository navigation
Kiro: drop the private final answer when a real tool call shares the turn - #7437
hedging8563 wants to merge 1 commit into
Conversation
…turn The model can send a real tool call and the private final-answer call in one turn, because the prompt tells it to put independent calls in one block. The parser treated both orders as a protocol error. The client got a non-retryable 502, and a combo cannot fall back once a tool event is out. Now the turn continues through the real tools. The parser drops the completion call, ends the turn with endTurn false, and logs one line: "[kiro] dropped the private final-answer call". The answer is held until the stream ends and is never relayed, so the drop has no client-visible effect. In the order "completion first, then real tool", only the model's ordinary prose is released, as commentary with the tool call. These stay errors: a second completion call, a completion call while explicit completion is disabled, and a malformed completion. Tests: new tests/providers/kiro/kiro-completion-with-real-tools.test.ts covers both orders, several real tools, the bounded retry leg, a plain completion, two completions, a malformed completion and the disabled mode, for the streamed and the buffered parse. 10 of its 17 cases fail without the change. The old kiro-stream case that expected an error for the mixed turns now only keeps the duplicate completion. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
|
Follow-up intake at |
Problem: The model can send a real tool call and the private final-answer call in one turn. The parser treated both orders as a protocol error; the client got a non-retryable 502 and a combo cannot fall back once a tool event is out.
Fix: The turn continues through the real tools. The parser drops the completion call, ends the turn with endTurn false and logs "[kiro] dropped the private final-answer call". The answer is held until the stream ends and never relayed. Completion first then real tool: only ordinary prose is released as commentary. A second completion, a completion while explicit completion is disabled, and a malformed completion stay errors.
Tests: new tests/providers/kiro/kiro-completion-with-real-tools.test.ts (17 cases, 10 fail without the change); kiro-stream test updated. tsc --noEmit clean; tests/providers/kiro (665 pass, 0 fail); test-layout 27 pass. No overlap with #7389 or later dev commits.
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.