Skip to content

fix: default api_type for specific github copilot models#2376

Open
joshbarrington wants to merge 1 commit intodocker:mainfrom
joshbarrington:fix/githubcopilot-model-defaults
Open

fix: default api_type for specific github copilot models#2376
joshbarrington wants to merge 1 commit intodocker:mainfrom
joshbarrington:fix/githubcopilot-model-defaults

Conversation

@joshbarrington
Copy link
Copy Markdown
Contributor

@joshbarrington joshbarrington commented Apr 10, 2026

closes: #2303

Some Github Copilot models require the /responses endpoint as opposed to /chat/completions.

These are not set by default, and so certain models will fail unless a custom agent config is set with api_type: openai_responses. This sets the default for these models as openai_responses.

@liketosweep

@joshbarrington joshbarrington requested a review from a team as a code owner April 10, 2026 15:48
@joshbarrington
Copy link
Copy Markdown
Contributor Author

joshbarrington commented Apr 10, 2026

@liketosweep can you also test this? I've actually ran out of Github Copliot credit 😆 .

dgageot
dgageot previously approved these changes Apr 10, 2026
@liketosweep
Copy link
Copy Markdown

Hey @joshbarrington, just saw @dgageot gave it the green light! I was getting ready to pull it down but ran out of time on my end tonight before logging off. Thrilled it got approved and is ready to merge though great fix.

@joshbarrington
Copy link
Copy Markdown
Contributor Author

@dgageot I just realised it makes sense to call the function earlier inside applyModelDefaults to avoid returning early.

I'll push that change now

Comment thread pkg/model/provider/provider.go Outdated
dgageot
dgageot previously approved these changes Apr 13, 2026
@joshbarrington
Copy link
Copy Markdown
Contributor Author

@dgageot who else can we get a quick review from so we can get this fix in?

Comment thread pkg/model/provider/provider.go Outdated
@joshbarrington
Copy link
Copy Markdown
Contributor Author

@dgageot please re-review

@joshbarrington joshbarrington changed the title Fix default api_type for specific github copilot models fix: default api_type for specific github copilot models Apr 27, 2026
@joshbarrington joshbarrington force-pushed the fix/githubcopilot-model-defaults branch from 93090f9 to 52a34cd Compare April 28, 2026 08:43
@joshbarrington
Copy link
Copy Markdown
Contributor Author

@dgageot i have rebased this if you can reapprove for the CI jobs :)

@joshbarrington
Copy link
Copy Markdown
Contributor Author

@dgageot friendly bump

@aheritier
Copy link
Copy Markdown
Contributor

/review

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Good fix — the logic is sound and the ordering within applyProviderDefaultsapplyModelDefaults is correct. CI is green. A few non-blocking suggestions below, mostly around test coverage and style consistency.

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Overall this is a clean, well-scoped fix. The logic is correct and handles the ordering concern well (overriding openai_chatcompletions that may have been set by the generic fallback). CI is all green.

All comments are non-blocking — this is mergeable as-is. The suggestions are just for style consistency and better test coverage.

Comment thread pkg/model/provider/defaults.go Outdated
Comment thread pkg/model/provider/defaults.go
Comment thread pkg/model/provider/model_defaults_test.go
Comment thread pkg/model/provider/provider_defaults_test.go
Copy link
Copy Markdown

@docker-agent docker-agent Bot left a comment

Choose a reason for hiding this comment

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

Assessment: 🟡 NEEDS ATTENTION

2 findings — 1 LIKELY, 1 CONFIRMED (both medium severity)

Severity File Issue
🟡 MEDIUM defaults.go:242 User-set api_type: openai_chatcompletions silently overridden
🟡 MEDIUM model_defaults_test.go:297 Missing test assertions for gpt-5.4-mini and gpt-5.4-nano

Comment thread pkg/model/provider/defaults.go
Comment thread pkg/model/provider/model_defaults_test.go
aheritier
aheritier previously approved these changes May 6, 2026
Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

Clean, well-scoped fix. Logic is correct, tests cover the main cases, CI is green. A few non-blocking suggestions below.

Copy link
Copy Markdown
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

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

A few non-blocking suggestions inline. Nice fix overall — clean logic, good test coverage of the happy path, and CI is green.

Comment thread pkg/model/provider/defaults.go
Comment thread pkg/model/provider/defaults.go Outdated
Comment thread pkg/model/provider/model_defaults_test.go
Comment thread pkg/model/provider/provider_defaults_test.go
@aheritier aheritier added kind/fix PR fixes a bug (maps to fix: commit prefix) area/providers/openai For features/issues/fixes related to the usage of OpenAI models priority:high Major impact, should be addressed within 2 days labels May 6, 2026
@joshbarrington
Copy link
Copy Markdown
Contributor Author

@aheritier thanks for the review, I've added the suggested improvements 👍

@joshbarrington joshbarrington force-pushed the fix/githubcopilot-model-defaults branch from 2983f35 to d8cc381 Compare May 6, 2026 22:40
@aheritier aheritier added effort:small Isolated change, clear solution, single area and removed priority:high Major impact, should be addressed within 2 days labels May 7, 2026
@aheritier aheritier added the go Pull requests that update go code label May 7, 2026
@joshbarrington joshbarrington force-pushed the fix/githubcopilot-model-defaults branch from 70b2649 to e3c7b09 Compare May 7, 2026 19:56
@joshbarrington
Copy link
Copy Markdown
Contributor Author

@aheritier @dgageot have rebased and cleaned this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/providers/openai For features/issues/fixes related to the usage of OpenAI models effort:small Isolated change, clear solution, single area go Pull requests that update go code kind/fix PR fixes a bug (maps to fix: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

copilot: unsupported_api_for_model

5 participants