Skip to content

ai/live: Send trickle errors down to processStream#3671

Merged
j0sh merged 2 commits intomasterfrom
ja/event-errors
Jul 15, 2025
Merged

ai/live: Send trickle errors down to processStream#3671
j0sh merged 2 commits intomasterfrom
ja/event-errors

Conversation

@j0sh
Copy link
Collaborator

@j0sh j0sh commented Jul 11, 2025

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.

image

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:

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
@j0sh j0sh requested review from leszko, mjh1 and victorges July 11, 2025 08:21
@github-actions github-actions bot added go Pull requests that update Go code AI Issues and PR related to the AI-video branch. labels Jul 11, 2025
@codecov
Copy link

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.

Project coverage is 31.69665%. Comparing base (dab7dad) to head (b1f6c1a).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
server/ai_mediaserver.go 0.00000% 22 Missing ⚠️
server/ai_live_video.go 0.00000% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 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     
Files with missing lines Coverage Δ
server/ai_process.go 1.68067% <ø> (ø)
server/ai_live_video.go 0.00000% <0.00000%> (ø)
server/ai_mediaserver.go 4.50192% <0.00000%> (-0.07006%) ⬇️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dab7dad...b1f6c1a. Read the comment docs.

Files with missing lines Coverage Δ
server/ai_process.go 1.68067% <ø> (ø)
server/ai_live_video.go 0.00000% <0.00000%> (ø)
server/ai_mediaserver.go 4.50192% <0.00000%> (-0.07006%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}
if !orchSwapper.shouldSwap(ctx) {
err = errors.New("Not swapping: kicking")
// TODO return an error from shouldSwap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just add it in this PR?

Copy link
Collaborator Author

@j0sh j0sh Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly trying to minimize the scope of changes in this PR, but I can add it.

@j0sh j0sh enabled auto-merge (squash) July 15, 2025 22:17
@j0sh j0sh merged commit 0a77ad0 into master Jul 15, 2025
15 of 16 checks passed
@j0sh j0sh deleted the ja/event-errors branch July 15, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Issues and PR related to the AI-video branch. go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants