Skip to content

refactor(core): consolidate model error mapping - #45722

Merged
kitlangton merged 1 commit into
v2from
model-error-mapping
Aug 28, 2026
Merged

kitlangton merged 1 commit into
v2from
model-error-mapping

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why
Generate maps three ModelResolver failure tags through identical explicit-versus-implicit selection logic. Effect supports catching a non-empty tag list with one narrowed handler.

What Changes
Replaces the three duplicate handlers with one multi-tag catchTag handler. Explicit model requests still fail with ModelSelectionError; implicit resolution still fails with UnavailableError carrying the resolver provider ID.

Scope
The no-model fallback, AI generation error mapping, and separate Integration authorization message remain unchanged. PR #45398 also touches generate.ts for Bedrock region behavior but does not consolidate these resolver handlers.

Verification

cd packages/core
bun typecheck
bun run test test/generate.test.ts test/model-resolver.test.ts
cd ../..
bunx oxlint packages/core/src/generate.ts

Core typecheck passed, all 41 focused tests passed, and oxlint reported no warnings or errors. The push hook completed the 33-package workspace typecheck.

@kitlangton
kitlangton merged commit 0b82fe6 into v2 Aug 28, 2026
10 checks passed
@kitlangton
kitlangton deleted the model-error-mapping branch August 28, 2026 03:12
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant