Skip to content

fix: keep streamed text when providers skip text-start#16654

Open
tsubasakong wants to merge 28 commits intoanomalyco:devfrom
tsubasakong:lucas/opener-a/anomalyco-opencode-5210
Open

fix: keep streamed text when providers skip text-start#16654
tsubasakong wants to merge 28 commits intoanomalyco:devfrom
tsubasakong:lucas/opener-a/anomalyco-opencode-5210

Conversation

@tsubasakong
Copy link
Copy Markdown

@tsubasakong tsubasakong commented Mar 9, 2026

Issue for this PR

Closes #5210

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Issue #5210 reports that some providers emit text-delta events without a preceding text-start, which caused streamed assistant text to be dropped instead of being attached to the current output part.

This PR creates the current assistant text part on the first text-delta when a provider skips text-start, keeps subsequent deltas/end metadata attached to that same part, and adds a focused regression test for the delta-first streaming path.

How did you verify your code works?

I ran git diff --cached --check locally and also attempted the focused regression test with bun test test/session/processor.test.ts --timeout 30000, but that broader run was blocked in this worktree because local dependencies such as zod and drizzle-orm were not installed.

Screenshots / recordings

Not applicable — this change is in the streaming/session processing path.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 9, 2026
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Custom OpenAI-compatible provider returns no text content

1 participant