fix(agents): filter unrelated OpenCode session errors#142
Merged
Conversation
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.
Summary
sessionIDso errors from other sessions do not fail the current run.Risk Assessment
✅ Low: The changes are narrowly scoped to OpenCode SSE output/error handling and add targeted unit/e2e coverage for the altered behavior, with the prior session-filtering issue addressed.
Testing
npx vitest run "src/core/agents/opencode.test.ts"npm run buildnpx vitest run "e2e/e2e.test.ts" -t "reports an OpenCode provider overload"Pipeline
Updates from git push no-mistakes
✅ **Rebase** - passed
Round 1 - passed ✅
🔧 **Review** - 1 issue found → auto-fixed
Round 1 - found 1 warning
src/core/agents/opencode.ts:847- Payload-wrapped stream errors can includeproperties.sessionID, but this now extracts and records the error before the existing session filter. Because/global/eventis a global stream, asession.errorfor another session could fail the current run; accept payload-wrapped errors only when theirsessionIDmatches, while still allowing top-level provider errors that have no session id.Round 2 (auto-fix) - passed ✅
✅ **Test** - passed
Round 1 - passed ✅
npx vitest run "src/core/agents/opencode.test.ts"npm run buildnpx vitest run "e2e/e2e.test.ts" -t "reports an OpenCode provider overload"✅ **Document** - passed
Round 1 - passed ✅
🔧 **Lint** - 1 issue found → auto-fixed
Round 1 - found 1 warning
e2e/e2e.test.ts:386- Prettier reported a formatting issue in the changed file; auto-formatted the assertion wrapping withnpx prettier --write e2e/e2e.test.ts.Round 2 (auto-fix) - passed ✅
✅ **Push** - passed
Round 1 - passed ✅