You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
V2: define typed LLM errors for consumer-owned retry policy #34995
The LLM package should not decide retry policy, but opencode needs useful typed failures to implement its own policy. AI SDK errors are currently hard to interpret, especially for midstream provider failures.
Scope
Review packages/llm/src/schema/errors.ts and executor error mapping.
Prioritize context overflow, provider/API errors, transport failures, auth/config failures, and midstream provider failures.
Preserve raw provider details where useful without hardcoding brittle provider-specific status semantics.
Remove retry-policy language from public errors if it implies package-owned retries.
Acceptance Criteria
Consumers can distinguish context overflow from generic provider failure.
Midstream provider failure is surfaced ergonomically.
Errors include enough status/header/body/provider detail for opencode retry policy.
No error API implies automatic retries inside @opencode-ai/llm.
Audit: several recent PRs chip away at typed LLM/provider failures (#35671 Z.AI overflow classification, #36130 nested OpenAI stream errors, #36163 typed provider/compaction errors), but this still looks like a broader error-contract issue. Keeping open.
Done: packages/ai/src/schema/errors.ts now has typed failure reasons (context-overflow classification, auth, rate limit, transport, incomplete-stream midstream failures), each with raw body and HTTP status/headers. Retry policy lives in core (packages/core/src/model-retry.ts); isRetryable is only an advisory helper.
Activity
opencode-agent commentedon Jul 10, 2026
Audit: several recent PRs chip away at typed LLM/provider failures (#35671 Z.AI overflow classification, #36130 nested OpenAI stream errors, #36163 typed provider/compaction errors), but this still looks like a broader error-contract issue. Keeping open.
neriousy commentedon Oct 21, 2026
Done: packages/ai/src/schema/errors.ts now has typed failure reasons (context-overflow classification, auth, rate limit, transport, incomplete-stream midstream failures), each with raw body and HTTP status/headers. Retry policy lives in core (packages/core/src/model-retry.ts);
isRetryableis only an advisory helper.