fix: align GitHub Copilot model variants with catalog#3353
Conversation
|
All contributors have signed the CLA. Thank you! ✅ |
There was a problem hiding this comment.
No issues found across 8 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Aligns GitHub Copilot variants with catalog capabilities, splitting fallback chains to ensure valid variant requests (e.g., high instead of max for Opus), backed by updated regression tests.
There was a problem hiding this comment.
Pull request overview
Aligns GitHub Copilot-specific model fallback entries with the models.jsonl catalog by separating Copilot variants from shared fallback chains, and updates regression coverage to lock in the new ordering/normalization behavior.
Changes:
- Split shared fallback-chain entries into provider-specific siblings for Copilot Claude Opus (forcing
variant: "high") and Copilot Gemini (omittingvariant). - Add/adjust tests covering settings compatibility and Copilot runtime capability normalization edge-cases.
- Update model-fallback tests/snapshots and isolate the auto-update plugin-entry test from user config leakage via an isolated config dir.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/model-settings-compatibility.test.ts | Adds regression tests for Copilot variant handling when metadata limits variants / when variant is omitted. |
| src/shared/model-requirements.ts | Splits Copilot Claude Opus + Gemini entries from shared chains to match catalog expectations. |
| src/shared/model-requirements.test.ts | Updates ordering/length assertions to reflect split fallback entries. |
| src/shared/model-capabilities.test.ts | Adds tests for Copilot runtime metadata edge cases (object-form variants, empty variants object). |
| src/plugin/event.model-fallback.test.ts | Updates model-fallback expectations to prefer the new adjacent Copilot Opus split entry. |
| src/hooks/model-fallback/hook.test.ts | Updates fallback progression assertions to match the new chain ordering and Copilot Opus high variant. |
| src/hooks/auto-update-checker/checker/plugin-entry.test.ts | Prevents local user config contamination by forcing an isolated OPENCODE_CONFIG_DIR in the spawned process. |
| src/cli/snapshots/model-fallback.test.ts.snap | Snapshot updates reflecting new fallback ordering and Copilot variant behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
|
Follow-up cleanup for stale GitHub Copilot nano references is tracked separately in #3359. This PR intentionally keeps that work out of scope and only covers the Copilot variant alignment changes. |
|
Validation note: the expected GitHub Copilot variant behavior here is version-qualified. The local CLI check used during validation was based on opencode 1.4.0 with the command "opencode models github-copilot --verbose", which reported claude-opus-4.7 with low / medium / high variants. A different OpenCode project/version line can expose a different catalog basis. For example, anomalyco/opencode v1.4.11 also exposes a "models [provider] --verbose" command: Its provider transform also contains provider-specific handling for GitHub Copilot Claude Opus 4.7: So catalog comparisons here should always name the exact OpenCode project/version they came from. This PR was validated against the local opencode 1.4.0 catalog behavior, not a generic cross-version catalog assumption. |
There was a problem hiding this comment.
0 issues found across 9 files (changes from recent commits).
Auto-approved: Aligns GitHub Copilot model variants with the actual catalog. Splitting fallback chains ensures correct variants (medium for Opus 4.7) are used, verified by extensive snapshot and unit tests.
Summary
opencode models github-copilot --verboseoutput by splitting Copilot-specific Opus and Gemini entries from shared fallback chainsbun run typecheck, andbun run buildChanges
claude-opus-4.7fallback entries tovariant: mediumbecause the currentopencode models github-copilot --verboseoutput exposes only themediumvariant for Opus 4.7claude-opus-4-7fallback entries onvariant: max, since the medium-only restriction is specific to GitHub Copilotgemini-3.1-pro-previewfallback entries because the currentopencode models github-copilot --verboseoutput does not expose a Gemini variant set thereTesting
opencode models github-copilot --verbosebun test src/cli/model-fallback.test.ts src/shared/model-requirements.test.ts src/hooks/model-fallback/hook.test.ts src/plugin/event.model-fallback.test.ts src/hooks/anthropic-effort/index.test.ts src/hooks/think-mode/index.test.tsbun run typecheckbun run buildNotes
dev