opencode/packages/llm/src
Aiden Cline fce506b3f9 refactor(llm): replace LLMError reasons with flat tagged union
Replace the LLMError { module, method, reason } wrapper with a flat
tagged union (LLM.BadRequest, LLM.Authentication, LLM.PermissionDenied,
LLM.NotFound, LLM.RateLimit, LLM.QuotaExceeded, LLM.ContentPolicy,
LLM.ContextOverflow, LLM.ServerError, LLM.APIError, LLM.ConnectionError,
LLM.TimeoutError, LLM.MalformedResponse, LLM.NoRoute) plus an isLLMError
guard. Add one shared classifyApiFailure classifier used by the HTTP
executor and the AI SDK adapter so both surfaces classify identically,
preserving status, headers, body, and retry-after.

Core policy moves onto tags: retry RateLimit | ServerError |
ConnectionError | TimeoutError; toSessionError adds
provider.context-overflow, provider.timeout, and provider.not-found.

The provider-error stream event and the runner's held-back overflow
handling are unchanged here; isContextOverflowFailure now bridges old
events and new tags until the event is removed.
2026-07-13 12:21:21 -05:00
..
protocols refactor(llm): replace LLMError reasons with flat tagged union 2026-07-13 12:21:21 -05:00
providers feat(llm): complete provider package entrypoints (#35907) 2026-07-08 18:41:46 +05:30
route refactor(llm): replace LLMError reasons with flat tagged union 2026-07-13 12:21:21 -05:00
schema refactor(llm): replace LLMError reasons with flat tagged union 2026-07-13 12:21:21 -05:00
utils Refactor LLM route-first provider API (#28523) 2026-05-20 20:15:52 -04:00
cache-policy.ts Refactor LLM route-first provider API (#28523) 2026-05-20 20:15:52 -04:00
index.ts refactor(llm): replace LLMError reasons with flat tagged union 2026-07-13 12:21:21 -05:00
llm.ts refactor(llm): replace LLMError reasons with flat tagged union 2026-07-13 12:21:21 -05:00
provider-error.ts refactor(llm): replace LLMError reasons with flat tagged union 2026-07-13 12:21:21 -05:00
provider-package.ts feat(core): flatten provider config and load native packages (#35563) 2026-07-06 16:18:56 -04:00
provider.ts chore: merge dev into v2 (#34788) 2026-07-01 17:12:00 -04:00
tool-runtime.ts chore: generate 2026-06-04 03:03:39 +00:00
tool.ts refactor(core): simplify location filesystem (#31545) 2026-06-09 14:28:45 -04:00