Skip to content

fix(opencode): retry certificate verification errors - #37885

Closed
storyicon wants to merge 1 commit into
anomalyco:devfrom
storyicon:cert-retry
Closed

storyicon wants to merge 1 commit into
anomalyco:devfrom
storyicon:cert-retry

Conversation

@storyicon

Copy link
Copy Markdown

Issue for this PR

Closes #37884

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

unknown certificate verification error was classified as UnknownError, so it bypassed the existing session retry policy and stopped the turn.

This change classifies that specific transport failure as a retryable APIError. It preserves the original error message and reuses the existing retry backoff. TLS verification remains enabled, and other certificate errors are unchanged.

How did you verify your code works?

  • Added a regression test covering error classification and retry detection.
  • Ran bun test test/session/retry.test.ts from packages/opencode: 34 tests passed.
  • Ran bun typecheck from packages/opencode.
  • Ran the pre-push monorepo typecheck: 30 packages passed.
  • Ran Prettier and diff checks on the changed files.

Screenshots / recordings

Not applicable; this is not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@thdxr thdxr closed this Oct 10, 2026
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.

Certificate verification errors bypass session retry

2 participants