feat(copilot): support model: auto/model: none to bypass model pinning on automatic-selection plans#46556
model: auto/model: none to bypass model pinning on automatic-selection plans#46556Conversation
…election Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ng comment line Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
model: auto/model: none to bypass model pinning on automatic-selection plans
|
@copilot the BYOK route requires a model id |
… in BYOK mode - `addCopilotModelEnv` now accepts `isBYOKMode bool`; when the `auto`/`none` sentinel is set and BYOK is active it falls through to the org-variable expression (with `CopilotBYOKDefaultModel` as final fallback) instead of skipping COPILOT_MODEL injection entirely. - `applyCopilotModelAliasResolution` in the JS harness now checks `COPILOT_PROVIDER_BASE_URL` before deleting COPILOT_MODEL for sentinel values; in BYOK mode the sentinel is ignored and COPILOT_MODEL is preserved. - Tests added for both the Go and JS paths. Fixes: https://github.com/github/gh-aw/pull/XXXXX#issuecomment-5014891414 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…for BYOK sentinel case Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed. When Two-layer fix committed in the latest push:
The non-BYOK sentinel behaviour (Copilot Free auto-selection) is unchanged. |
There was a problem hiding this comment.
Pull request overview
Adds Copilot automatic model routing for plans that reject explicitly pinned models.
Changes:
- Adds
autoandnonemodel sentinels. - Omits or clears
COPILOT_MODELfor automatic routing. - Adds Go and JavaScript coverage plus release notes.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/model_env_vars_test.go |
Tests sentinel compilation behavior. |
pkg/workflow/copilot_engine_execution.go |
Handles sentinels when building step environments. |
pkg/constants/engine_constants.go |
Defines sentinel constants. |
actions/setup/js/resolve_model_alias.test.cjs |
Tests sentinel alias resolution. |
actions/setup/js/resolve_model_alias.cjs |
Resolves sentinels to no model. |
actions/setup/js/copilot_harness.test.cjs |
Tests runtime environment handling. |
actions/setup/js/copilot_harness.cjs |
Clears sentinels before Copilot execution. |
.changeset/patch-copilot-auto-model-sentinel.md |
Documents the user-facing fix. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 3
- Review effort level: Medium
|
@copilot update dev.md to use copilot auto and summarize the readme.
|
…md to copilot auto; add model: auto to 10 workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot please run the Failed checks: Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "pi.dev"See Network Configuration for more information.
|
Done in the latest commit:
The BYOK sentinel handling is now fully corrected in the latest commit. When |
…s.cjs Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
All checks on run Next maintainer action: merge the PR. |
|
/smoke-copilot |
|
📰 BREAKING: Smoke Copilot is now investigating this issue comment. Sources say the story is developing... |
|
@copilot make sure auto is configure in the awf command https://github.com/github/gh-aw/actions/runs/29716577546/job/88271094667#step:48:1 |
|
@copilot please run the Recent maintainer request: Run: https://github.com/github/gh-aw/actions/runs/29716826331 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "pi.dev"See Network Configuration for more information.
|
…e 258 workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
/smoke-copilot |
|
📰 BREAKING: Smoke Copilot is now investigating this issue comment. Sources say the story is developing... |
|
@copilot remove experiments from smoke-copilot and set model: auto |
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Smoke test review: comments recorded; no blocking verdict.
📰 BREAKING: Report filed by Smoke Copilot · 11.6 AIC · ⌖ 2.28 AIC · ⊞ 18.9K
Comment /smoke-copilot to run again
Add label smoke to run again
|
@copilot resolve the merge conflicts on this branch. |
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
5 similar comments
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
Root cause investigated (run 29716577546, job 88271094667 — step 48 "Execute GitHub Copilot CLI"):
Fix applied (commit Added // "auto" is a no-op pass-through sentinel: return it unchanged so the AWF proxy
// receives COPILOT_MODEL=auto and performs proxy-side automatic model selection.
if (configuredModel.toLowerCase() === "auto") {
logger(`copilot model pass-through sentinel '${configuredModel}': skipping alias resolution for proxy-side automatic model selection`);
return configuredModel;
}This ensures Blocker: |
|
@copilot resolve the merge conflicts on this branch. |
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
1 similar comment
|
@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
On Copilot Free (and similar plans limited to automatic model selection), every request fails with HTTP 400 because the engine always injects an explicit
COPILOT_MODEL— which the gateway rejects for these plans. Settingmodel: gpt-5-minior any other alias produces the same 400 since the plan disallows any pinned model.Changes
New sentinels
autoandnoneforengine.model— when either is set, the compiler omitsCOPILOT_MODELfrom the step env entirely, letting the Copilot CLI use its native automatic routing.CopilotAutoModelSentinel = "auto",CopilotNoModelSentinel = "none"inpkg/constants/engine_constants.goaddCopilotModelEnvincopilot_engine_execution.goreturns early without settingCOPILOT_MODELfor these valuesRuntime defense-in-depth in
resolve_model_alias.cjs—resolveConfiguredCopilotModelreturns""forauto/none(case-insensitive), andapplyCopilotModelAliasResolutionin the harness callsdelete process.env.COPILOT_MODELwhen it receives an empty resolution result, covering the case where someone sets the sentinel viaengine.envUsage
model: noneis a synonym. Both values are inert with respect to alias resolution and bypass the org-variable fallback (GH_AW_MODEL_AGENT_COPILOT) as well.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
pi.devSee Network Configuration for more information.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
pi.devSee Network Configuration for more information.