Skip to content

Copilot native Auto routing: --auto-tier conflicts with harness resolution of auto to a fixed model #74970

Backlog

Description

@bobbrand

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

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:

  1. Recognize an explicit --auto-tier VALUE or --auto-tier=VALUE before model resolution. Ignore prompt values and arguments after --.
  2. Require the selected invocation model to be exactly auto; reject empty/conflicting profiles, SDK mode, and simultaneous AWF model routing before spawning the CLI.
  3. Pass preserveAuto: true only for that explicit native CLI mode.
  4. 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 typecheck

549 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

  1. locked and limited conversation to collaborators on Nov 4, 2026
  2. unlocked this conversation on Nov 4, 2026
  3. pelikhan commented on Nov 7, 2026

    @pelikhan
    Collaborator

    @SivaKesava1 can you take a peek?

  4. SivaKesava1 commented on Nov 7, 2026

    @SivaKesava1
    Collaborator

    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_URL pointing at AWF's proxy, and COPILOT_PROVIDER_WIRE_API fixed at launch. gh-aw has to resolve the model before launch to choose that API (applyCopilotWireAPI), which is why auto becomes a fixed model (auto → large → sonnet, so claude-sonnet-5.5 today). Keeping auto would 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/session handshake. That's a design change in AWF and gh-aw, so we'll track it separately. For now:

    • For automatic model choice, use engine.model-routing (for example goal: cost, mode: economy). That's gh-aw's supported way to pick a model per run.
    • We should make --auto-tier fail fast before launch with a clear message, instead of failing after retries.

    cc @lpcox

  5. lpcox commented on Nov 7, 2026

    @lpcox
    Collaborator
  6. lpcox commented on Nov 13, 2026

    @lpcox
    Collaborator

    🔗 AWF tracking issue: github/gh-aw-firewall#11514

    Generated by Firewall Issue Dispatcher · copilot · auto (Claude Sonnet 5.5) · ~20 AIC · ⊞ 5.8K · ◷

  7. added
    backlog:engines
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-inspectedawfbacklog:enginescommunity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions