Skip to content

fix: align GitHub Copilot model variants with catalog#3353

Closed
divlook wants to merge 8 commits into
code-yeongyu:devfrom
divlook:fix/copilot-variant-alignment
Closed

fix: align GitHub Copilot model variants with catalog#3353
divlook wants to merge 8 commits into
code-yeongyu:devfrom
divlook:fix/copilot-variant-alignment

Conversation

@divlook

@divlook divlook commented Apr 11, 2026

Copy link
Copy Markdown

Summary

  • align GitHub Copilot fallback variants with the current opencode models github-copilot --verbose output by splitting Copilot-specific Opus and Gemini entries from shared fallback chains
  • add regression coverage for requirements, compatibility, runtime capability normalization, model-fallback flows, and plugin-entry isolation
  • verify the change with focused model fallback tests, bun run typecheck, and bun run build

Changes

  • set GitHub Copilot claude-opus-4.7 fallback entries to variant: medium because the current opencode models github-copilot --verbose output exposes only the medium variant for Opus 4.7
  • keep non-Copilot claude-opus-4-7 fallback entries on variant: max, since the medium-only restriction is specific to GitHub Copilot
  • remove explicit variant from GitHub Copilot gemini-3.1-pro-preview fallback entries because the current opencode models github-copilot --verbose output does not expose a Gemini variant set there
  • update fallback, anthropic-effort, think-mode, snapshot, and regression expectations for the corrected Copilot Opus behavior
  • isolate the auto-update plugin-entry test from local user config leakage

Testing

  • opencode models github-copilot --verbose
  • bun 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.ts
  • bun run typecheck
  • bun run build

Notes

  • target branch: dev
  • communication for review should stay in English
  • please ensure CLA requirements are satisfied before review/merge

Copilot AI review requested due to automatic review settings April 11, 2026 18:37
@github-actions

github-actions Bot commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (omitting variant).
  • 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.

@divlook

divlook commented Apr 11, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@divlook

divlook commented Apr 11, 2026

Copy link
Copy Markdown
Author

recheck

github-actions Bot added a commit that referenced this pull request Apr 11, 2026
@divlook

divlook commented Apr 12, 2026

Copy link
Copy Markdown
Author

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.

@divlook

divlook commented Apr 19, 2026

Copy link
Copy Markdown
Author

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:
https://github.com/anomalyco/opencode/blob/a35b8a95c27d28e979a3826e1289d7ee87f40251/packages/opencode/src/cli/cmd/models.ts#L12-L30

Its provider transform also contains provider-specific handling for GitHub Copilot Claude Opus 4.7:
https://github.com/anomalyco/opencode/blob/a35b8a95c27d28e979a3826e1289d7ee87f40251/packages/opencode/src/provider/transform.ts#L392-L398
https://github.com/anomalyco/opencode/blob/a35b8a95c27d28e979a3826e1289d7ee87f40251/packages/opencode/src/provider/transform.ts#L426-L432

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.

github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 22, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 22, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@divlook divlook closed this Apr 28, 2026
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.

2 participants