| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
The following comment was made by an LLM, it may be inaccurate: The search results show that PR #19311 (the current PR) is related to PR #17742, but they are not duplicates — they are complementary:
According to the PR description, both should be merged as they provide complete coverage: prevention + recovery. No duplicate PRs found |
Sorry, something went wrong.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Sorry, something went wrong.
…tabase Empty text and reasoning parts with blank or whitespace-only text can be stored in the database during streaming (from text-start events that receive no deltas, or when streams are interrupted). These empty parts cause permanent ValidationException errors with providers like AWS Bedrock, especially when using LiteLLM proxy (@ai-sdk/openai-compatible). This fix adds defensive filtering at two levels: 1. When hydrating parts from database (filters on load) 2. When converting to model messages (filters during conversion) Both filters use .trim() to catch whitespace-only content. Fixes anomalyco#19309 Complements anomalyco#17742 (prevention) with recovery for existing corruption
| Back | FazBrowse Home | New Git URL |
Issue for this PR
Closes #19309
Type of change
What does this PR do?
Adds defensive filtering when loading parts from the database to handle corrupted sessions with empty text/reasoning blocks. This complements PR #17742's prevention approach.
Problem
Users with already-corrupted databases (empty text blocks stored in part table) experience permanent ValidationException errors with AWS Bedrock, especially when using LiteLLM proxy (@ai-sdk/openai-compatible). PR #17742 prevents future corruption but doesn't fix existing corrupted data.
Solution
Filter empty text/reasoning parts at two levels:
Both use .trim() to catch whitespace-only content.
Why this approach?
Relationship to PR #17742
Both PRs should be merged for complete coverage:
How did you verify your code works?
New tests added (5 test cases in message-v2.test.ts):
All existing tests pass: 26 tests, 41 expect() calls, 0 failures
Typecheck passes: bun run typecheck completes with no errors
Real-world validation: Tested with database containing 26 empty parts - sessions load successfully without ValidationException
Screenshots / recordings
N/A - Backend logic change, no UI impact
Checklist