Skip to content

fix(kiro): keep progress text nonterminal#369

Merged
lidge-jun merged 1 commit into
lidge-jun:devfrom
mushikingh:fix/kiro-progress-requires-completion
Jul 24, 2026
Merged

fix(kiro): keep progress text nonterminal#369
lidge-jun merged 1 commit into
lidge-jun:devfrom
mushikingh:fix/kiro-progress-requires-completion

Conversation

@mushikingh

@mushikingh mushikingh commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reproduction: on a tool-enabled Kiro request, an assistantResponseEvent containing progress text followed by a clean Smithy EOF was emitted as commentary but also completed with end_turn: true. A response such as "I am checking" could therefore terminate Codex or Claude Code before the model produced a final answer.
  • Keep ordinary text and reasoning nonterminal while Kiro explicit completion is required. Both now enter the existing single bounded continuation; a validated private completion or accepted fallback text remains the only final terminal.
  • Add adapter and public /v1/responses plus /v1/messages regressions proving progress is preserved structurally, the continuation runs exactly once, and the private completion tool never leaks.
  • Update the transport source of truth to match the restored behavior.

Verification

  • bun test --isolate tests/kiro-stream.test.ts tests/server-kiro-completion-e2e.test.ts (58 pass)
  • bun run typecheck
  • bun run test (3933 pass across 314 files)
  • bun run privacy:scan
  • git diff --check

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. No authentication or credential code changes are included.

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of incomplete streamed responses by validating progress before finalizing.
    • Added a single bounded completion attempt when text or reasoning ends without a final answer.
    • Preserved progress messages as commentary before displaying the final response.
    • Prevented internal completion details from appearing in streamed output.
  • Tests

    • Expanded coverage for progress-only responses and fallback completion behavior across supported endpoints.

@github-actions github-actions Bot added the bug Something isn't working label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dff138be-6b00-4e78-99a3-09b21e59ca25

📥 Commits

Reviewing files that changed from the base of the PR and between 4c8b09a and c9cedc4.

📒 Files selected for processing (4)
  • src/adapters/kiro.ts
  • structure/04_transports-and-sidecars.md
  • tests/kiro-stream.test.ts
  • tests/server-kiro-completion-e2e.test.ts

📝 Walkthrough

Walkthrough

Kiro required-mode turns containing text or reasoning now use one bounded completion fallback. Unit and end-to-end tests verify retry state and progress/final-answer streaming across Responses and Messages endpoints, and transport documentation reflects the updated behavior.

Changes

Kiro completion fallback

Layer / File(s) Summary
Required-mode fallback control flow
src/adapters/kiro.ts, tests/kiro-stream.test.ts
Required-mode text or reasoning output now triggers one bounded fallback; tests verify retry conversation state, tools, request count, and commentary/final-answer phases.
Endpoint propagation and transport documentation
tests/server-kiro-completion-e2e.test.ts, structure/04_transports-and-sidecars.md
Responses and Messages tests verify progress followed by final output, and documentation describes fallback for both text and reasoning EOFs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant KiroStream
  participant KiroAdapter
  participant CompletionFallback
  participant APIEndpoints
  KiroStream->>KiroAdapter: progress text or reasoning
  KiroAdapter->>CompletionFallback: request bounded completion
  CompletionFallback-->>KiroAdapter: final answer
  KiroAdapter-->>APIEndpoints: commentary and final_answer output
Loading

Possibly related PRs

Suggested reviewers: ingwannu, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: Kiro progress text is kept nonterminal instead of ending the turn.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@lidge-jun
lidge-jun merged commit 2704747 into lidge-jun:dev Jul 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants