Skip to content

fix(model): reject incomplete OpenAI-compatible streams - #676

Merged
mohitranka merged 1 commit into
mainfrom
fix/investigate-premature-stop
Sep 14, 2026
Merged

mohitranka merged 1 commit into
mainfrom
fix/investigate-premature-stop

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Chat Completions streams ending at an output limit or without a completion signal were returned as successful partial answers, leaving cut-off work marked ready.

  • Validate finish_reason and [DONE] termination on the OpenAI-compatible transport (covers OpenCode Go / DeepSeek).
  • Output-limit, early EOF, and stream-level errors now return explicit incomplete-turn errors.
  • Tools from incomplete responses are never committed; Continue remains the resume path.
  • Document behavior in README providers section.

Validation:

  • cargo test --package forge-model --locked native::openai::tests (18 passed)
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings

Chat Completions streams that end at an output limit or without a completion signal were returned as successful partial answers. Validate finish_reason and [DONE] termination so truncated work surfaces as an incomplete-turn error instead of false success. Tools from incomplete responses are never committed.
@mohitranka
mohitranka merged commit 8853113 into main Sep 14, 2026
3 checks passed
@mohitranka
mohitranka deleted the fix/investigate-premature-stop branch September 14, 2026 15:24
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.

1 participant