Skip to content

fix: suppress false incomplete response warnings - #10800

Merged
catrielmuller merged 6 commits into
mainfrom
troubled-hawk
Jun 2, 2026
Merged

fix: suppress false incomplete response warnings#10800
catrielmuller merged 6 commits into
mainfrom
troubled-hawk

Conversation

@catrielmuller

Copy link
Copy Markdown
Contributor

Issue

No linked issue; this fixes a false incomplete-response warning regression found during local work.

Context

Completed turns can be misclassified as unexpected or incomplete when the terminal assistant message is not real user-visible assistant output. This can happen when an OpenAI Responses stream ends after producing output without a terminal response event, and when VS Code snapshot initialization status appears as an assistant tail.

While preparing the PR, the pre-push typecheck also exposed stale Kilo-owned WorktreeFamily submodule test code that no longer matched the current Effect/Instance APIs, so this branch includes the minimal fix required for the hook to pass.

Implementation

  • Reclassify OpenAI Responses streams that omit the terminal response chunk based on observed output, so tool-call streams finish as tool-calls and text streams finish as stop instead of other.
  • Teach the VS Code turn outcome helper to skip snapshot-only assistant tail messages when choosing the terminal finish reason.
  • Update the Kilo-owned WorktreeFamily submodule regression test to the current Effect harness and use the yielded instance context in production code.
  • Add regression coverage for missing terminal Responses events and snapshot-only tails, plus patch changesets for the CLI and VS Code extension.

Screenshots / Video

N/A - no visual changes.

How to Test

Manual/local verification

  • Agent ran bun test ./test/kilocode/provider/openai-responses-finish.test.ts from packages/opencode/ - passed.
  • Agent ran bun test ./test/kilocode/worktree-family-submodule.test.ts ./test/kilocode/worktree-family.test.ts ./test/kilocode/provider/openai-responses-finish.test.ts from packages/opencode/ - passed.
  • Agent ran bun run typecheck from packages/opencode/ - passed.
  • Agent ran bun test tests/unit/session-outcome.test.ts from packages/kilo-vscode/ - passed.
  • Agent ran bun run typecheck from packages/kilo-vscode/ - passed.
  • Agent ran bun run script/check-opencode-annotations.ts from the repo root - passed.
  • Agent ran bun run format from packages/kilo-vscode/ - passed.
  • Agent pushed with the pre-push hook, which ran bun turbo typecheck - passed.

Reviewer test steps

  1. Use an OpenAI Responses-compatible provider path that completes a tool call without sending a terminal response event.
  2. Confirm the completed tool-call turn does not show an unexpected incomplete-response warning.
  3. In the VS Code extension, produce a real assistant turn followed by a snapshot initialization status tail.
  4. Confirm the turn outcome uses the real assistant finish reason and does not warn solely because of the snapshot status tail.
  5. Run the WorktreeFamily submodule regression test to confirm submodule worktrees still resolve to their working tree instead of the internal gitdir.

Blocked checks and substitute verification

  • Agent attempted bun run test:unit -- session-outcome from packages/kilo-vscode/, but the script ran the full unit suite and failed in unrelated tests/unit/worktree-manager.test.ts with Expected: "remote" and Received: "local-tracking"; substitute verification was the direct targeted session outcome test above.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

N/A

@kilo-code-bot

kilo-code-bot Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (13 files)
  • .changeset/calm-snapshot-warnings.md
  • .changeset/tidy-responses-finish.md
  • packages/kilo-vscode/tests/unit/session-outcome.test.ts
  • packages/kilo-vscode/webview-ui/src/components/shared/TurnOutcome.tsx
  • packages/kilo-vscode/webview-ui/src/context/session-outcome.ts
  • packages/kilo-vscode/webview-ui/src/context/session-utils.ts
  • packages/opencode/src/kilocode/session/processor.ts
  • packages/opencode/src/kilocode/session/prompt.ts
  • packages/opencode/src/kilocode/worktree-family.ts
  • packages/opencode/src/session/processor.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/kilocode/session/processor-effect.test.ts
  • packages/opencode/test/kilocode/session/prompt.test.ts

Notes

Incremental review of commit 60f4c052 (refactor: isolate the changes inside of the kilo folders)

This commit is a clean fork hygiene refactoring — no new issues found.

guardEmptyResponse + parse in kilocode/session/processor.ts — Two new exported helpers. guardEmptyResponse wraps emptyResponseError in an Effect that fails when the guard fires. parse consolidates preserveError + MessageV2.fromError into one call. preserveError is now private to the namespace (unexported), which is the right scope. Both reduce the diff footprint on the shared session/processor.ts.

rejectPayloadOverflow in kilocode/session/prompt.ts — Extraction of the inline oversized-payload block from session/prompt.ts into a properly named Effect helper. Structurally identical to the previous inline block — returns false on no overflow, true after writing the error, publishing the event, setting idle status, and recording the close reason.

Shared file call sitessession/processor.ts:550 and session/prompt.ts:1736 each shrink to a single kilocode_change-annotated line calling the new helpers. Functionally equivalent.

Tests moved from test/session/ to test/kilocode/session/ — The two kilo-specific tests ("retry empty other provider finishes" and "does not send payload that remains large after pruning") now live in kilo-owned test directories. The kilocode_change markers wrapping them in the shared test files are correctly removed. Test logic is identical.

lgtm


Reviewed by claude-4.6-sonnet-20260217 · 890,337 tokens

Review guidance: REVIEW.md from base branch main

@marius-kilocode marius-kilocode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the Copilot specific changes, they look incorrect.

# Conflicts:
#	packages/opencode/src/kilocode/worktree-family.ts
#	packages/opencode/src/session/prompt.ts
#	packages/opencode/test/kilocode/worktree-family-submodule.test.ts
@catrielmuller
catrielmuller merged commit 19b2f31 into main Jun 2, 2026
19 checks passed
@catrielmuller
catrielmuller deleted the troubled-hawk branch June 2, 2026 12:52
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
fix: suppress false incomplete response warnings
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.

2 participants