Skip to content

fix(provider): prefer explicit provider IDs for current-model filtering - #224

Merged
slkiser merged 2 commits into
slkiser:mainfrom
ugiya:provider-id-filtering
Aug 16, 2026
Merged

fix(provider): prefer explicit provider IDs for current-model filtering#224
slkiser merged 2 commits into
slkiser:mainfrom
ugiya:provider-id-filtering

Conversation

@ugiya

@ugiya ugiya commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • prefer canonical explicit provider IDs and unique runtime aliases before model-name matching
  • use model matching only to disambiguate shared runtime IDs such as google, while unknown explicit IDs fail closed
  • preserve exact model-level matching for custom quota-providers
  • keep intentional current-model filtering visible in verbose diagnostics without counting it as compact-status issues
  • preserve the diagnostic discriminator through sanitization and persisted cache validation, with regression coverage for selection, compact output, and model-sensitive cache invalidation

This PR is intentionally limited to issue #223. It does not include the unreleased OpenCode live-model accessor or the additional formatting/reactivity changes from the local integration.

Linked Issue

Fixes #223

OpenCode Validation

  • Current production released OpenCode version tested: 1.18.18
  • Why this version is relevant to the fix: it supplies providerID separately from an unprefixed modelID, reproducing the identity mismatch described in the issue.

Environment

  • macOS 26.5.1 on Apple Silicon (arm64)
  • OpenCode 1.18.18
  • opencode-quota base version 4.8.1
  • Node.js 24.16.0; pnpm 11.0.0
  • TUI compact status with onlyCurrentModel: true and multiple explicit providers
  • Reproduction selection: { "providerID": "openai", "modelID": "gpt-5.6-sol" }

This PR is tested against the released host contract and does not depend on the proposed OpenCode live-model accessor.

Verification Performed

pnpm verify passed twice: once immediately before commit and again in the repository's pre-push hook. The gate completed Biome checks, the pinned TypeScript check, history/privacy verification, typecheck, build, the full test suite, four-surface parity, and package-content verification.

Results:

  • 173 test files and 1,943 tests passed
  • four-surface parity: 2 tests passed
  • npm package contents: 616 files verified

Focused regression coverage verifies:

  • canonical openai selects OpenAI for unprefixed gpt-5.6-sol
  • unique runtime aliases such as chatgpt, codex, and chutes-ai select their catalog provider
  • shared google identity is disambiguated by Gemini versus Antigravity model metadata
  • unknown explicit providers and OpenRouter do not fall through to OpenAI-looking model names
  • custom quota-providers retain exact provider/model matching
  • intentional current-model exclusions stay in verbose diagnostics but do not become compact +N issues
  • genuine provider errors still count in compact output
  • the diagnostic kind survives persisted-cache validation
  • changing only the selected model invalidates model-scoped custom-provider output

Manual reproduction used the OpenCode 1.18.18 TUI compact status with the environment and selection above.

Quality Checklist

  • I ran pnpm run typecheck
  • I ran pnpm run build
  • I ran pnpm test
  • This change is focused and avoids unrelated behavior changes
  • I updated or added tests when behavior changed
  • I updated docs when user-facing workflow, command, or config behavior changed (not required: none changed)
  • For provider changes, I followed Provider Changes, or this does not apply (no provider is added)

ugiya and others added 2 commits August 16, 2026 01:24
Exclude Antigravity-prefixed models from the shared Gemini matcher.\n\nReject normalization-only aliases when OpenCode reports an explicit provider ID.
@slkiser
slkiser merged commit 6d26963 into slkiser:main Aug 16, 2026
3 checks passed
@slkiser

slkiser commented Aug 16, 2026

Copy link
Copy Markdown
Owner

@ugiya Thanks for fix!

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.

[bug]: Prefer explicit provider ID for current-model filtering

2 participants