Repository navigation
Add regression test for invisible provider stream-error retries - #30
Merged
bezbac merged 1 commit intoAug 19, 2026
Merged
Conversation
opencode retries provider stream errors inside its session processor, re-streaming the same assistant message; the plugin sees no session.error and no lifecycle event for the aborted attempt (only a session.status retry). Pin that the retried message settles into exactly one exported generation spanning the retry window, with usage from the successful attempt, and that every subsequent tool observation's parent resolves to an exported span - the invariant that was violated in 0.1.0, where tools after a retry referenced never-exported generation spans.
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.
Fixes #21
Opening this as a draft for maintainer review, as invited in the issue.
What
Adds a regression test to
test/integration/plugin.test.tscovering opencode's invisible provider stream-error retries. When a provider stream errors mid-call, opencode retries inside its session processor and re-streams the same assistant message. The plugin sees nosession.errorand no lifecycle event for the aborted attempt, only asession.statusretry.Why
In 0.1.0 this sequence left tool observations parented to generation spans that were never exported, so the tools were orphaned in Langfuse. The test pins the current (fixed) behavior so it can't regress:
How tested
pnpm run test:integrationpasses (14 tests).step.span.end()call intraceGeneration, and separately disabling the start-after-completion guard instartActiveGenerationStep, both make it fail.