gh-aw icon indicating copy to clipboard operation
gh-aw copied to clipboard

Copilot engine: `?effort=` model suffix is passed to the Copilot CLI as part of the model name, and every request fails with 502

Open MSroczynski3 opened this issue 1 week ago • 0 comments

Summary

With engine.id: copilot, a model such as gpt-6-luna?effort=high compiles without warnings, but the ?effort=high suffix is not converted into a reasoning-effort setting. The Copilot CLI receives the full string as the model name, and every model request fails with a 502. The agent job fails after all retries with zero tokens used.

Versions

  • gh-aw compiler: v1.2.1
  • gh-aw-firewall: v0.29.7
  • Engine: copilot (CLI mode), GitHub-hosted ubuntu-latest runner

Reproduce

engine:
  id: copilot
  model: gpt-6-luna?effort=high
  1. gh aw compile succeeds. The lock file contains COPILOT_MODEL: gpt-6-luna?effort=high.
  2. Run the workflow.

Actual behaviour

[INFO] COPILOT_MODEL 'gpt-6-luna?effort=high' is not in this AWF version's offline catalog; deferring validation to runtime provider discovery
[copilot-harness] model resolution: engine=copilot role=main configured=gpt-6-luna?effort=high resolved=gpt-6-luna?effort=high provider=(unscoped) status=exact
[copilot-harness] inference routing: mode=cli configuredModel="gpt-6-luna?effort=high" endpoint=managed-by-copilot-cli
agent session.start model=gpt-6-luna?effort=high reasoningEffort=medium
Failed to get response from the AI model; retried 5 times. Last error: 502 Upstream request failed and no fallback model could be dispatched
[copilot-harness] attempt 4 failed: exitCode=1 failureClass=capi_server_error ... tokenCount=0

The session runs at reasoningEffort=medium, so the suffix has no effect on effort. The failure is classified as a transient capi_server_error, which hides the cause.

With model: gpt-6-luna and no suffix, the same workflow succeeds.

Expected behaviour

One of:

  • the copilot engine maps ?effort=<level> to --reasoning-effort <level> and passes the plain model name to the CLI, or
  • compilation fails (or warns) when a ?effort= suffix is used with an engine that does not translate it.

What the docs say

The Model Alias Specification (docs/src/content/docs/specs/model-alias-specification.md at v1.2.1) describes this exact configuration as supported:

  • Section 6.1 (effort): "Implementations MUST map these values to the provider's native reasoning-control API parameter."

  • The examples in the same section use the copilot engine:

    # Workflow using opus with high effort
    engine:
      id: copilot
      model: opus?effort=high
    
  • Appendix A.3 separates the two: "The engine is invoked with model copilot/claude-opus-4.5 and parameters: effort = high".

So the spec says the parameter is split from the model name and applied as reasoning effort. For the copilot engine in CLI mode, neither happens.

Where it happens (v1.2.1)

  • actions/setup/js/resolve_model_alias.cjs:461 documents that "?effort= and other parameters carry through", so the resolved model keeps the suffix.
  • actions/setup/js/copilot_harness.cjs:1081 adds --reasoning-effort only on the model-routing path (selection.effort), not for a suffix on engine.model.
  • docs/src/content/docs/reference/engines.md:234 says "Parameters such as ?effort= are retained", which reads as if the suffix is supported for all engines.
  • The built-in alias table includes "opusplan": ["opus?effort=high"], so the suffix looks like the intended way to set effort.

Workaround

engine:
  id: copilot
  model: gpt-6-luna
  args: ["--reasoning-effort", "high"]

This compiles to a plain COPILOT_MODEL and adds --reasoning-effort high to the CLI command line. I have not yet confirmed the effort level in a live run.

MSroczynski3 avatar Nov 19 '26 14:11 MSroczynski3