Skip to content

test: cover copilot model limit precedence#32365

Open
wgu9 wants to merge 1 commit into
anomalyco:devfrom
wgu9:wgu9/fix-copilot-limit-overrides
Open

test: cover copilot model limit precedence#32365
wgu9 wants to merge 1 commit into
anomalyco:devfrom
wgu9:wgu9/fix-copilot-limit-overrides

Conversation

@wgu9

@wgu9 wgu9 commented Jun 15, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #21564

Related: #31064, #32343

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This adds provider-level regression coverage for GitHub Copilot model limit precedence.

The current implementation already has the right behavior: Copilot OAuth model discovery refreshes stale catalog limits, and an explicit user config override still wins after discovery. This PR locks that contract at Provider.list() so future provider merge changes do not regress the 1M+ context cases or user-configured token limits.

The covered cases are:

  • Copilot catalog has an existing gpt-5.5 entry, but live /models returns larger limits.
  • Live discovery projects context, input, and output into the provider model.
  • User config can override the live discovered context, input, and output.
  • OAuth auth is present, so the test exercises the Copilot discovery path instead of the unauthenticated fallback.
  • The global fetch stub is restored after each test so other provider tests stay isolated.

How did you verify your code works?

  • bun test test/provider/provider.test.ts
  • bun test test/plugin/github-copilot-models.test.ts
  • bun test test/provider/provider.test.ts -t "github copilot"
  • bunx oxlint packages/opencode/test/provider/provider.test.ts
  • git diff --check

bun run typecheck still fails on the current dev tree in packages/core/src/v1/config/migrate.ts because info.limit.context and info.limit.output can be undefined there. This PR does not touch that code path.

Screenshots / recordings

Not applicable. This is provider contract coverage.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

Related PR:

The other results (PR #29354 on per-model limit overrides, PR #20758 on Copilot support, and PR #20491 on Kiro provider) are related to the broader ecosystem but are not direct duplicates addressing the same test coverage need.

The current PR (#32365) appears to be the only one specifically focused on adding regression test coverage for Copilot model limit precedence, so there are no duplicate test PRs found.

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.

GitHub Copilot plugin ignores user-configured model limit overrides

1 participant