Skip to content

Kiro: drop the private final answer when a real tool call shares the turn - #7434

Merged
lidge-jun merged 1 commit into
lidge-jun:devfrom
hedging8563:kiro-final-answer-502
Oct 28, 2026
Merged

lidge-jun merged 1 commit into
lidge-jun:devfrom
hedging8563:kiro-final-answer-502

Conversation

@hedging8563

@hedging8563 hedging8563 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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.

Verification

Author: 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.

Maintainer carry (2026-10-28): the branch was rebased onto current dev as one commit (7c3b5af21, authorship kept, Co-authored-by trailer) and the new test registration moved from scripts/test-layout/layout.json into the layout-providers.json shard, as the 2026-10-24 triage asked. On that head with Bun 1.4.4: kiro-completion-with-real-tools, kiro-stream, kiro-single-final, file-size ratchet and both layout guards: 183 pass / 0 fail; bun run typecheck and bun run structure:check pass. NOT RUN locally: full bun run test (left to PR CI).

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (structure/providers/kiro.md).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (no auth or credential surface).

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.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 47 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4cdcb50 and 7c3b5af.

Files selected for processing: 6
  • scripts/test-layout/layout-providers.json
  • src/adapters/kiro/stream.ts
  • structure/providers/kiro.md
  • tests/fixtures/test-layout-expected.json
  • tests/providers/kiro/kiro-completion-with-real-tools.test.ts
  • tests/providers/kiro/kiro-stream.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ 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.

0/4 boxes ticked.

Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked.

Hygiene

✅ Deterministic PR hygiene checks passed.

@Ingwannu

Copy link
Copy Markdown
Owner

Follow-up intake at 7cbdc795bb7ede92c32cabc8ea28059b9a06d0b1 against dev 12025981e5a304cdb6b1b54f525ba8554f623977. This PR and #7437 have the identical head 7cbdc795bb7ede92c32cabc8ea28059b9a06d0b1, target dev, and identical changed-file lists/patches. Please retain one canonical review PR (the newer #7437 can carry this discussion) and close the other as duplicate. The substantive mixed-completion/tool review is recorded on #7437. No code or author branch was changed here.

@lidge-jun

Copy link
Copy Markdown
Owner

Triage note (2026-10-24, against dev at 2494848).

Needs fixes before this can land: shard the new test registration; supply Summary/Verification/Checklist and current readiness evidence; obtain successful executable CI.

Still needed on dev: yes. Both mixed-call orders remain protocol errors (src/adapters/kiro/stream.ts:462, :578).

Exact-head CI at triage time: 7cbdc79 — policy checks and CodeRabbit pass, but ci.yml run 39386199246 is FAILURE with zero jobs. No failing job/check name is available; this is not evidence of failing tests. lane=all on exact head: n.a.

Please refresh onto current dev when addressing these; heads older than dev need a fresh exact-head CI run before review.

…turn

Rebased onto current dev as one commit (lidge-jun#7434); the new test is
registered in the providers layout shard instead of layout.json.

Co-authored-by: hedging8563 <45883076+hedging8563@users.noreply.github.com>
@lidge-jun
lidge-jun force-pushed the kiro-final-answer-502 branch from 7cbdc79 to 7c3b5af Compare October 28, 2026 02:57
@lidge-jun
lidge-jun marked this pull request as ready for review October 28, 2026 03:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-28T03:33:38.634734Z
We couldn’t complete this review. Comment @codex review to try again.
7c3b5af Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions
github-actions Bot marked this pull request as draft October 28, 2026 03:28
@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev (MAINTAINERS.md, "Review and merge policy"). This is maintainer integration, not an approving review.

  • Exact head 7c3b5af2117903f1df3f63a42d06aff41a790325: the contribution rebased onto dev as one commit, with the new test registration moved into the layout-providers.json shard (the 2026-10-24 triage ask). No conflict with current dev.
  • Exact-head PR CI: Cross-platform CI 40623928855 (gates, test 1/4-4/4, ci), Catalog async contracts 40623928909, enforce-target: all success.
  • Review: a real tool call and the private final-answer call in one turn now continue through the real tools and drop the held final answer (logged); a second completion, a completion in disabled mode and a malformed completion stay protocol errors. Local on this head (Bun 1.4.4): Kiro completion/stream/single-final, ratchet and layout guards 183 pass / 0 fail; typecheck and structure check pass.

Thank you @hedging8563.

@lidge-jun
lidge-jun marked this pull request as ready for review October 28, 2026 03:32
@lidge-jun
lidge-jun merged commit aef4b6a into lidge-jun:dev Oct 28, 2026
34 of 37 checks passed
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.

4 participants