Repository navigation
Description
Summary
With gh-aw v1.0.1 and Copilot CLI v1.0.105, explicitly requesting native Auto routing with --auto-tier=balance fails before inference. The harness resolves COPILOT_MODEL=auto as a gh-aw alias to a concrete model, then forwards --auto-tier to the CLI. The CLI rejects that combination:
Error: Auto preference requires the selected model to be `auto`.
The same resolution path remains in main at b1b58dd33ddcbcfecdb2b7bd4a47e7baae4ec18d. This report contains only public upstream implementation details and a synthetic offline reproduction; no private workflow content or runtime artifacts are included.
Minimal configuration
Relevant engine configuration, with an authenticated sandbox otherwise configured normally:
engine:
id: copilot
version: "1.0.105"
checksums-sha256: "1c3c3f505229401c3e56ba9e0a45acef02e563da09e6a857a975d9187fdd46da"
model: auto
args:
- --auto-tier=balance--auto-tier balance has the same problem. CLI v1.0.105 help describes this flag as the Auto routing profile, validated against the available catalog.
Expected versus actual
Expected: An explicit native routing profile preserves auto through CLI launch, allowing Copilot CLI to select the concrete model. Keep model observation and firewall/usage safeguards enabled.
Actual: applyCopilotModelAliasResolution resolves auto before launch. The fixed model conflicts with the native Auto profile. Default harness retries repeat the same deterministic configuration error.
Bare model: auto without a native routing profile may retain its current gh-aw alias semantics; this report is specifically about explicit --auto-tier.
Root cause and existing building blocks
applyCopilotModelAliasResolutiondoes not passpreserveAutotoresolveEngineModel.resolveConfiguredModelalready supportspreserveAuto.createCopilotModelObserveralready treats expectedautoas dynamic selection and records the concrete observed model, rather than treating it as a fixed-model substitution.
Candidate fix, tested offline
I prepared a local candidate against the above main revision. It uses the existing resolver option rather than replacing the harness or disabling the firewall:
- Recognize an explicit
--auto-tier VALUEor--auto-tier=VALUEbefore model resolution. Ignore prompt values and arguments after--. - Require the selected invocation model to be exactly
auto; reject empty/conflicting profiles, SDK mode, and simultaneous AWF model routing before spawning the CLI. - Pass
preserveAuto: trueonly for that explicit native CLI mode. - Keep existing alias resolution unchanged when no native profile is supplied, and retain model observation.
The core candidate addition to copilot_harness.cjs is:
/**
* An explicit CLI routing profile distinguishes native Auto from the gh-aw alias.
* @param {string[]} args
* @param {string} model
* @param {{sdkMode?: boolean, routed?: boolean}} [options]
*/
function isCopilotNativeAuto(args, model, { sdkMode = false, routed = false } = {}) {
let tier = "";
for (let i = 0; i < args.length && args[i] !== "--"; i++) {
if (args[i] === "--prompt" || args[i] === "-p") {
i++;
continue;
}
if (args[i] !== "--auto-tier" && !args[i].startsWith("--auto-tier=")) continue;
const value = args[i] === "--auto-tier" ? args[++i] : args[i].slice("--auto-tier=".length);
if (!value?.trim() || value.startsWith("-")) throw new Error("Copilot --auto-tier requires a non-empty routing profile");
if (tier && tier !== value) throw new Error("Conflicting Copilot --auto-tier arguments");
tier = value;
}
if (!tier) return false;
if (sdkMode || routed) throw new Error("Copilot --auto-tier requires native CLI Auto routing, not SDK or AWF model routing");
if (model !== "auto") throw new Error("Copilot --auto-tier requires the selected model to be 'auto'");
return true;
}In main, after invocation-model selection and modelRoutingRequired initialization:
const nativeAuto = isCopilotNativeAuto(resolvedArgs, configuredCopilotModel, {
sdkMode: copilotSDKMode,
routed: modelRoutingRequired,
});Reject a subsequently returned modelRoutingSelection when nativeAuto is true. Pass nativeAuto into applyCopilotModelAliasResolution, and add its optional boolean to the JSDoc options type. Its resolveEngineModel call then includes:
preserveAuto: options.nativeAuto === true,This intentionally does not change all engines' interpretation of the auto alias. Profile availability remains the CLI's catalog validation responsibility.
Offline regression evidence
The synthetic end-to-end harness test uses an explicit AWF alias map:
{ auto: ["copilot/gpt-5.6-luna"] }It supplies a recorded public upstream reflect fixture and a stub CLI which rejects an Auto profile if the received model is not auto, then writes an observed concrete-model session event.
- Before candidate: both flag forms fail because the stub receives the resolved fixed model.
- After candidate: both pass and preserve this model-selection evidence:
{
"status": "observed",
"configured_model": "auto",
"resolved_model": "auto",
"effective_model": "gpt-5.6-luna"
}Additional regressions cover unchanged bare-auto alias behavior, fixed-model/profile conflict rejected before CLI spawn, empty/conflicting profiles, SDK/AWF routing conflicts, and prompt/option-delimiter handling.
From actions/setup/js:
npm run test:js -- --no-file-parallelism copilot_harness.test.cjs resolve_model_alias.test.cjs copilot_model_selection.test.cjs
npm run typecheck549 tests passed; type checking and targeted Prettier checks passed.
Remaining validation
This is an offline-tested candidate, not a claim of end-to-end native Fusion compatibility. It still needs maintainer review and a bounded live test of CLI routing through AWF, concrete-model observation, endpoint compatibility, and dynamic usage/credit accounting. No bypass of authentication, sandboxing, model access policy, or spend controls is proposed. If native Fusion is intentionally unsupported, an actionable pre-launch diagnostic and explicit documentation would also prevent this confusing alias/profile failure.
Activity
pelikhan commentedon Nov 7, 2026
@SivaKesava1 can you take a peek?
SivaKesava1 commentedon Nov 7, 2026
Thanks @bobbrand, the diagnosis is right, but the fix needs more than
preserveAuto. Under AWF, Copilot CLI runs in offline + BYOK mode:COPILOT_OFFLINE=true,COPILOT_PROVIDER_BASE_URLpointing at AWF's proxy, andCOPILOT_PROVIDER_WIRE_APIfixed at launch. gh-aw has to resolve the model before launch to choose that API (applyCopilotWireAPI), which is whyautobecomes a fixed model (auto → large → sonnet, soclaude-sonnet-5.5today). Keepingautowould most likely still not get Copilot's Auto, because the CLI treats the BYOK endpoint as a generic provider, and the API can't follow Auto's choice of model.Real native Auto needs the CLI to run in its native mode against AWF's proxy, which already forwards Auto's
/models/sessionhandshake. That's a design change in AWF and gh-aw, so we'll track it separately. For now:engine.model-routing(for examplegoal: cost,mode: economy). That's gh-aw's supported way to pick a model per run.--auto-tierfail fast before launch with a clear message, instead of failing after retries.cc @lpcox
lpcox commentedon Nov 7, 2026
@SivaKesava1 on it
lpcox commentedon Nov 13, 2026
🔗 AWF tracking issue: github/gh-aw-firewall#11514
ci: remove the weekly documentation audit (#49)