Context
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.
Context
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
packages/llm/src/schema/errors.tsand executor error mapping.Acceptance Criteria
@opencode-ai/llm.