Skip to content

fix(agents): filter unrelated OpenCode session errors#142

Merged
kunchenguid merged 3 commits into
mainfrom
ezoss/fix-141-20260506-165329-dibr0zww8l5s-2
May 6, 2026
Merged

fix(agents): filter unrelated OpenCode session errors#142
kunchenguid merged 3 commits into
mainfrom
ezoss/fix-141-20260506-165329-dibr0zww8l5s-2

Conversation

@kunchenguid
Copy link
Copy Markdown
Owner

Summary

  • Filter payload-wrapped OpenCode stream errors by matching sessionID so errors from other sessions do not fail the current run.
  • Preserve handling for top-level provider errors without a session id, including overload reporting.
  • Add OpenCode unit coverage and an e2e mock-server scenario for provider overload/error handling.

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

  • Summary: Exercised the OpenCode agent stream parsing changes and the targeted provider-overload e2e path; all focused tests passed.
  • npx vitest run "src/core/agents/opencode.test.ts"
  • npm run build
  • npx vitest run "e2e/e2e.test.ts" -t "reports an OpenCode provider overload"
  • Outcome: ✅ passed across 1 run (35.6s)

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 include properties.sessionID, but this now extracts and records the error before the existing session filter. Because /global/event is a global stream, a session.error for another session could fail the current run; accept payload-wrapped errors only when their sessionID matches, 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 build
  • npx 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 with npx prettier --write e2e/e2e.test.ts.

Round 2 (auto-fix) - passed ✅

✅ **Push** - passed

Round 1 - passed ✅

@kunchenguid kunchenguid merged commit 2093a4a into main May 6, 2026
5 checks passed
@kunchenguid kunchenguid deleted the ezoss/fix-141-20260506-165329-dibr0zww8l5s-2 branch May 6, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant