Skip to content

feat(streaming): log unrecognized chunks - #1512

Merged
steebchen merged 3 commits into
mainfrom
steebchen/log-unknown-chunks
Jan 29, 2026
Merged

steebchen merged 3 commits into
mainfrom
steebchen/log-unknown-chunks

Conversation

@steebchen

@steebchen steebchen commented Jan 27, 2026 •

Copy link
Copy Markdown
Member

Add logger.warn() calls to capture unrecognized streaming chunks from all providers (Anthropic, Google, OpenAI, AWS Bedrock) and unknown providers. Logs include context like provider name, model, and event/part details for easier debugging. This helps identify edge cases and new streaming formats.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added runtime diagnostic warnings for unrecognized streaming data and empty streaming responses across AI providers (Anthropic, Google/Vertex, OpenAI, AWS Bedrock), including contextual details (provider, model, event/type, data keys) to aid debugging.
    • Cleaned up and re-ordered imports for improved code maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

Add logger.warn() calls to capture unrecognized streaming chunks for
Anthropic, Google, OpenAI, AWS Bedrock, and unknown providers. Includes
context like provider, model, and event/part details for debugging.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jan 27, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds runtime warnings for unrecognized streaming data across multiple LLM providers (Anthropic, Google, OpenAI, AWS Bedrock) in the streaming transformation utility, and adds a detailed warning when an empty streaming response is detected during streaming. Also deduplicates an import statement in a UI component.

Changes

Cohort / File(s) Summary
Gateway: streaming transform
apps/gateway/src/chat/tools/transform-streaming-to-openai.ts
Adds runtime console warnings for unrecognized streaming chunk/part/event types from Anthropic, Google/Vertex, OpenAI, and AWS Bedrock; includes provider, model, event/type, and data keys in warnings; logs warning before falling back for unknown providers.
Gateway: streaming session detection
apps/gateway/src/chat/chat.ts
Adds a detailed warning log when an empty streaming response is detected during streaming, including provider, model, finishReason, token counts, content lengths, and tool calls; existing upstream_error behavior unchanged.
UI import cleanup
apps/ui/src/components/landing/hero-rsc.tsx
Moves allMigrations import to the top and removes a duplicate import later in the file; no runtime behavior changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

auto-merge

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(streaming): log unrecognized chunks' accurately describes the main objective of the pull request, which adds logging for unrecognized streaming chunks across multiple providers.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

Add logger.warn() for empty streaming responses to help debug issues
like Google AI Studio returning no content. Logs include token counts,
content length, and chunk metadata.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@steebchen
steebchen enabled auto-merge January 27, 2026 19:19
@steebchen
steebchen added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit 7db0bfe Jan 29, 2026
11 of 12 checks passed
@steebchen
steebchen deleted the steebchen/log-unknown-chunks branch January 29, 2026 00:48
steebchen added a commit that referenced this pull request Jan 29, 2026
Add logger.warn() calls to capture unrecognized streaming chunks from
all providers (Anthropic, Google, OpenAI, AWS Bedrock) and unknown
providers. Logs include context like provider name, model, and
event/part details for easier debugging. This helps identify edge cases
and new streaming formats.

🤖 Generated with Claude Code

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Added runtime diagnostic warnings for unrecognized streaming data and
empty streaming responses across AI providers (Anthropic, Google/Vertex,
OpenAI, AWS Bedrock), including contextual details (provider, model,
event/type, data keys) to aid debugging.
  * Cleaned up and re-ordered imports for improved code maintainability.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
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