ai/live: Send trickle errors down to processStream#3671
Merged
Conversation
This mitigates more tricky timing conditions. For example, stream EOS and the "swap disabled" message come close enough together that Metabase timestamps don't have enough granularity to distinguish them, so they get displayed out of order. Return any trickle errors down to processStream and preferentially use those if available. This also ensures we see a single error reason from trickle when swapping or kicking, rather than potentially several. The first error is generally closest to the root cause of an issue. If an orchestrator will be swapped, we report the error. If we are kicking the connection instead of swapping, then the kickInput function reports the error. Also see: * #3666 * #3663
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3671 +/- ##
===================================================
+ Coverage 31.69613% 31.69665% +0.00052%
===================================================
Files 156 156
Lines 47296 47311 +15
===================================================
+ Hits 14991 14996 +5
- Misses 31420 31431 +11
+ Partials 885 884 -1
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
leszko
approved these changes
Jul 14, 2025
| } | ||
| if !orchSwapper.shouldSwap(ctx) { | ||
| err = errors.New("Not swapping: kicking") | ||
| // TODO return an error from shouldSwap |
Contributor
There was a problem hiding this comment.
Why not just add it in this PR?
Collaborator
Author
There was a problem hiding this comment.
Mostly trying to minimize the scope of changes in this PR, but I can add it.
mjh1
approved these changes
Jul 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This mitigates more tricky timing conditions. For example, stream EOS and the "swap disabled" message come close enough together that Metabase timestamps don't have enough granularity to distinguish them, so they get displayed out of order. This is not great because we rely on the first error to be most proximate to the root cause.
Return any trickle errors down to processStream and preferentially use those if available.
This also ensures we see a single error reason from trickle when swapping or kicking, rather than potentially several. The first error is generally closest to the root cause of an issue.
If an orchestrator will be swapped, we report the error. If we are kicking the connection instead of swapping, then the kickInput function reports the error.
Also see: