You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support team-configurable default models with clear documentation #70297
Allow teams to configure which model gh-aw uses by default instead of always relying on the current built-in default.
Goals
Support: Define and implement a team-friendly way to set a preferred default model, including the scope and precedence of configuration and the circumstances in which it applies.
Document: Explain how to configure the model, which models/runtimes are supported, when the configuration takes effect, and any limitations or fallback behavior.
User-friendly: Make the setting discoverable, validate unsupported or incompatible values with actionable errors, and clearly report which model is selected and why.
Acceptance criteria
Teams can configure a preferred model without having to change every workflow individually.
The behavior is well-defined for explicit per-workflow model settings, team defaults, and the existing built-in default.
Supported configuration locations, precedence, eligibility conditions, and fallback/error behavior are documented.
Invalid or unsupported model choices produce clear, actionable feedback.
Existing workflows that do not opt into the new configuration continue to behave as they do today.
Teams have two ways to avoid choosing a model in every workflow: a team default model, or model routing, which picks the model for each run. Both work today.
Option 1: a team default model
For Copilot, Claude and Codex, set an organization or repository Actions variable:
gh variable set GH_AW_DEFAULT_MODEL_COPILOT --org MY_ORG --body "opus"
the phase-specific GH_AW_MODEL_AGENT_<ENGINE> / GH_AW_MODEL_DETECTION_<ENGINE>
GH_AW_DEFAULT_MODEL_<ENGINE>
gh-aw's built-in default
The value goes through the same model resolution as model:, so we recommend an alias (opus, sonnet, gpt-5, small) rather than an exact id. An alias follows the newest live model, so the default keeps working when Copilot retires a model; an exact id fails once it's gone.
Option 2: let model routing choose per run
Model routing (experimental) doesn't fix one model. For each run, a router classifies the task and picks a model and reasoning effort from the models your Copilot plan offers:
permissions:
copilot-requests: writeengine:
id: copilotmodel-routing:
goal: cost # or cost-speedmode: auto # or economy, balanced, robust
mode sets how likely the choice should be to succeed: economy for triage and labeling, balanced for general work, robust where a failed run is costly (for example opening PRs), and auto to decide per task.
goal picks among the choices that meet that target: the cheapest (cost) or the fastest (cost-speed).
Routing works with the Copilot, Claude, Codex and pi engines when they use Copilot inference behind the AWF firewall.
Making it team-wide. There is no organization variable for routing. Instead, put the routing settings, and optionally a model policy, in a shared file that workflows import (Shared routing settings):
# .github/workflows/shared/routing.md
---
engine:
id: copilotmodel-routing:
goal: costmode: automodels:
blocked: ["claude-opus-*"] # team guardrail: the firewall rejects these in every request
---
models.allowed / models.blocked is the team's model policy. It applies to every model request in the run (main agent and sub-agents), with or without routing, and imported policies are merged.
How routing and the default interact. When routing is enabled it chooses the main agent's model and effort, so it overrides model:, GH_AW_MODEL_AGENT_* and GH_AW_DEFAULT_MODEL_* (the compiler warns if a fixed model is also set). Threat detection and declared sub-agents keep their own models.
Which to use:
A team default fits when you want the same behaviour on every run, or you depend on one model's specific strengths.
Routing fits when tasks vary in difficulty and you want cost to follow the task, and it never pins a model name that can be retired.
Routing is still experimental: it chooses the main agent's model only, and the same task can occasionally get a different choice (known limitations).
Gaps we see
Pi (and Gemini/Agy) have no GH_AW_DEFAULT_MODEL_<ENGINE> variable.
Errors don't name the variable. When a team default names an unavailable model, the failure says the model is unavailable but not that GH_AW_DEFAULT_MODEL_<ENGINE> set it.
No organization-level routing default. Routing and model policies can be shared by import, but not set once for the whole organization.
@v1v, does one of these options cover what you need, or are you looking for something they can't express (for example, defaults per team within one organization, or an organization-wide routing default)?
Still relevant, but narrower than adding team defaults from scratch. Reviewed remote main at ffdd9c9.
Copilot/Claude/Codex already have organization/repository Actions defaults, with documented precedence: explicit workflow model → phase variable → engine default → built-in fallback. That satisfies the basic team-default path for those engines.
The actionable acceptance gap is reporting which setting selected the model and naming that setting when it fails. The override expression collapses the inputs to a value; the model-substitution diagnostic does not identify its originating Actions variable. #70349 is closed, unmerged, so its proposed provenance diagnostics are not shipped evidence.
Next action: carry the winning configuration source into selection metadata and unavailable/incompatible-model errors, with coverage for explicit, phase, default, and unset cases. Also resolve the supported-runtime scope explicitly: the registered default variables still cover only Copilot/Claude/Codex, not pi/Gemini/Agy. An organization-wide routing default remains a separate scope decision; shared routing imports require workflow opt-in and are not that default.
Activity
pelikhan commentedon Oct 19, 2026
@SivaKesava1 @rabecket
SivaKesava1 commentedon Oct 19, 2026
Teams have two ways to avoid choosing a model in every workflow: a team default model, or model routing, which picks the model for each run. Both work today.
Option 1: a team default model
For Copilot, Claude and Codex, set an organization or repository Actions variable:
Precedence, resolved when the workflow runs (see Compiler Enterprise Environment Controls):
model:in the workflow frontmatterGH_AW_MODEL_AGENT_<ENGINE>/GH_AW_MODEL_DETECTION_<ENGINE>GH_AW_DEFAULT_MODEL_<ENGINE>The value goes through the same model resolution as
model:, so we recommend an alias (opus,sonnet,gpt-5,small) rather than an exact id. An alias follows the newest live model, so the default keeps working when Copilot retires a model; an exact id fails once it's gone.Option 2: let model routing choose per run
Model routing (experimental) doesn't fix one model. For each run, a router classifies the task and picks a model and reasoning effort from the models your Copilot plan offers:
modesets how likely the choice should be to succeed:economyfor triage and labeling,balancedfor general work,robustwhere a failed run is costly (for example opening PRs), andautoto decide per task.goalpicks among the choices that meet that target: the cheapest (cost) or the fastest (cost-speed).Making it team-wide. There is no organization variable for routing. Instead, put the routing settings, and optionally a model policy, in a shared file that workflows import (Shared routing settings):
models.allowed/models.blockedis the team's model policy. It applies to every model request in the run (main agent and sub-agents), with or without routing, and imported policies are merged.How routing and the default interact. When routing is enabled it chooses the main agent's model and effort, so it overrides
model:,GH_AW_MODEL_AGENT_*andGH_AW_DEFAULT_MODEL_*(the compiler warns if a fixed model is also set). Threat detection and declared sub-agents keep their own models.Which to use:
Gaps we see
GH_AW_DEFAULT_MODEL_<ENGINE>variable.GH_AW_DEFAULT_MODEL_<ENGINE>set it.@v1v, does one of these options cover what you need, or are you looking for something they can't express (for example, defaults per team within one organization, or an organization-wide routing default)?
pelikhan commentedon Oct 22, 2026
Still relevant, but narrower than adding team defaults from scratch. Reviewed remote
mainatffdd9c9.Copilot/Claude/Codex already have organization/repository Actions defaults, with documented precedence: explicit workflow model → phase variable → engine default → built-in fallback. That satisfies the basic team-default path for those engines.
The actionable acceptance gap is reporting which setting selected the model and naming that setting when it fails. The override expression collapses the inputs to a value; the model-substitution diagnostic does not identify its originating Actions variable. #70349 is closed, unmerged, so its proposed provenance diagnostics are not shipped evidence.
Next action: carry the winning configuration source into selection metadata and unavailable/incompatible-model errors, with coverage for explicit, phase, default, and unset cases. Also resolve the supported-runtime scope explicitly: the registered default variables still cover only Copilot/Claude/Codex, not pi/Gemini/Agy. An organization-wide routing default remains a separate scope decision; shared routing imports require workflow opt-in and are not that default.