fix(assistant): persist failed stream progress#42
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR expands transient error detection for provider messages and captures partial streamed assistant output during prompt execution, persisting accumulated blocks and appending a custom error message when provider streaming fails. ChangesPartial Progress Persistence on Transient Errors
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
==========================================
+ Coverage 60.16% 60.31% +0.14%
==========================================
Files 168 168
Lines 16665 16755 +90
==========================================
+ Hits 10027 10105 +78
- Misses 5628 5635 +7
- Partials 1010 1015 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/assistant/runtime.go`:
- Around line 358-365: The current partialPromptProgress.append method drops
chunks consisting only of whitespace because it uses strings.TrimSpace(content);
change the early-return check to only skip truly empty strings (e.g., content ==
"" or len(content) == 0) so whitespace-only deltas are preserved; keep the
existing merge logic that appends content into
progress.blocks[lastIndex].Content and continue to use
canMergePartialPromptBlock(role) — i.e., remove the TrimSpace filtering so
partialPromptProgress.append, progress.blocks and canMergePartialPromptBlock are
left intact but whitespace content is not discarded.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9016ff19-a2a8-4193-b260-25c8242c8013
📒 Files selected for processing (5)
internal/assistant/retry.gointernal/assistant/retry_internal_test.gointernal/assistant/runtime.gointernal/assistant/runtime_lifecycle_test.gointernal/assistant/runtime_test.go
|



No description provided.