Repository navigation
Description
Summary
In Copilot SDK mode (engine.copilot-sdk: true), when the configured model is not in AWF's live /reflect catalogue, the harness silently runs the agent on whichever model sorts first in the catalogue. The run succeeds, and every record that states which model the run used says the configured model. AWF itself does not substitute here: /reflect reports Copilot fallback as suppressed (model_fallback_effective.copilot.suppression_reason: "copilot_standard_authoritative"). The substitution happens in gh-aw's harness.
Other paths fail closed on the same input: Pi rejects an unadvertised model at startup, the Copilot alias path refuses an unresolvable alias, and Copilot CLI mode receives 400 model_not_supported from the API.
Evidence
Audited with a gh aw dev build of main at d5ecd72.
daily-action-setup-security-audit.md pins model: claude-opus-4.8 with engine.copilot-sdk: true. Copilot removed claude-opus-4.8 from its catalogue on 16 Oct 2026.
| Run | Date (UTC) | Configured | Served (firewall token usage) | Conclusion |
|---|---|---|---|---|
| 38841405271 | 16 Oct 02:37 (before retirement) | claude-opus-4.8 |
claude-opus-4.8 |
success |
| 38995597867 | 17 Oct | claude-opus-4.8 |
claude-haiku-4.5 × 46 |
success |
| 39090720928 | 18 Oct | claude-opus-4.8 |
claude-haiku-4.5 × 31 |
success |
| 39191157830 | 19 Oct | claude-opus-4.8 |
claude-haiku-4.5 × 35 |
success |
In all three substituted runs, the harness logged:
[copilot-harness] inference routing: mode=sdk-byok source=awf-reflect configuredModel="claude-opus-4.8" resolvedModel="copilot-completions/claude-haiku-4.5" providerCount=2 modelRouteCount=23
In run 39191157830:
sandbox/firewall/awf-reflect.jsonhasmodels_fetch_complete: true. The configuredcopilotendpoint lists 40 models.claude-haiku-4.5is first,claude-opus-5.5is the only Opus model, andclaude-opus-4.8is absent.agent/model-resolution.json(unified-sessionmodel.resolution) records{configured_model: "claude-opus-4.8", resolved_model: "claude-opus-4.8", status: "exact", cause: null}.aw_info.jsonmodel, unified-sessionworkflow.info.model, andgh aw auditengine_config.modelall recordclaude-opus-4.8. The footer of the created issue [setup-security] Environment Variable Injection via OTLP Token in GitHub Actions Step #70120 saysopus48.- There is no
model_endpoint.mismatchevent, nocopilot-model-selection.json, and no audit finding about the substitution. The served model appears only in the raw records:firewall.token_usage, nativesession.start/session.init(model: copilot-completions/claude-haiku-4.5), andsession.shutdown.currentModel. Nothing reconciles these records with the configured model. - The detection job runs Copilot CLI with the same pin. The API proxy recorded
400 model_not_supportedforclaude-opus-4.8on/chat/completions. The step failed, butGH_AW_DETECTION_CONTINUE_ON_ERROR: truekept the job green. The 17 and 18 Oct runs show the same detection 400.
The 17 and 18 Oct runs predate the model.resolution record. They show the same harness log line and the same served model.
For contrast, Pi failed closed: run 38945917145 (Design Decision Gate, copilot/claude-opus-5) stopped at startup with fatal: Pi model "claude-opus-5" is not advertised by the configured copilot proxy endpoint, and gh aw audit reports model_unavailable.
Cause
- The resolution record says
exactwithout checking that the model is live.applyCopilotModelAliasResolution(copilot_harness.cjs#L479) callsresolveEngineModel.resolveConfiguredModel(resolve_model_alias.cjs#L493-L496) returnsstatus: "exact"for any name that is not an alias key, without checking the catalogue.claude-opus-4.8is not a key inapiProxy.models, so it is recorded asexact. - The SDK provider builder silently falls back to
models[0].resolveMultiProviderFromReflect(awf_reflect.cjs#L1092-L1097) says: "prefer the configured model if it appears in the model list; otherwise fall back to the first model across all providers." When a configured model is not live, it picks whichever model/reflectlists first (herecopilot-completions/claude-haiku-4.5). The unit testfalls back to first model when configured model is not found in list(awf_reflect.test.cjs#L1128) asserts this behaviour, so the test encodes the bug. - SDK mode has no model observer.
verifyModel = !copilotSDKMode && …(copilot_harness.cjs#L1519) disablescreateCopilotModelObserver. In CLI mode, that observer refuses silent model substitution.
Running these functions on main (d5ecd72) with run 39191157830's awf-reflect.json and awf-config.json reproduces the run:
| Configured model | resolveConfiguredModel |
resolveMultiProviderFromReflect primary |
|---|---|---|
claude-opus-4.8 |
claude-opus-4.8, exact |
copilot-completions/claude-haiku-4.5 |
copilot/claude-opus-4.8 |
copilot/claude-opus-4.8, exact |
copilot-completions/claude-haiku-4.5 |
opus |
copilot/claude-opus-5.5, resolved |
n/a |
copilot/gpt-5.4 |
n/a | copilot-responses/gpt-5.4 |
Proposed solution
In Copilot SDK mode, a configured model that is not in the live catalogue must fail closed, as Pi and the alias path already do.
- In the SDK branch of the harness, check the configured model after alias resolution and before starting the SDK. This applies only when no router selection exists. If the model is non-empty and matches no model on any configured
/reflectendpoint, do one bounded/reflectrefresh, reusing the alias path'srefetchReflectData. If it is still absent, refuse to start:- Log a clear error that names the model and the configured endpoints checked. Use the shared
ModelAliasResolutionError(configuredModel, "model_unavailable", { provider })message ("The requested model is not supported: '…' is not available in the workflow's live model catalog…").detect_agent_errorsalready classifies this message asmodel_not_supported_error, which the failure issue renders as "has an unavailable configured model". - Record
model.resolutionwithstatus: "failed",cause: "model_unavailable", andresolved_model: null. This must replace the earlierexactrecord forcopilot/main;recordModelResolutionalready replaces entries by engine and role. - Record the existing model selection with
status: "unavailable"(recordCopilotModelSelection), asapplyCopilotModelAliasResolutiondoes for unresolvable aliases. - Exit non-zero.
- Log a clear error that names the model and the configured endpoints checked. Use the shared
- Keep the "first model" fallback in
resolveMultiProviderFromReflectonly when no model is configured. When a model is configured but not found, return no primary model, or report that the model was not found, so the caller can fail. Never return another model. - Update the unit test that asserts the fallback for a configured-but-missing model, and say so in the PR description.
Note: Pi's failure issue for run 38945917145 (#69442) did not report model_unavailable; it reported failure_cause: unknown, because Pi's log message then lacked the shared text. On current main, Pi throws the shared ModelAliasResolutionError. Using that same error in the SDK path gives the same failure-issue classification.
Acceptance cases
Each case needs a named test. Use the real /reflect capture from run 39191157830 as the fixture, not an invented one. It is the agent artifact's sandbox/firewall/awf-reflect.json, with 40 Copilot models, models_fetch_complete: true, and no claude-opus-4.8. Add it under actions/setup/js/fixtures/, and confirm that it contains no credentials before committing.
- Configured
claude-opus-4.8with that reflect: no primary model is chosen, and the harness exits non-zero before starting the SDK.model.resolutionisfailed/model_unavailable, and the log names the model. - Configured
copilot/claude-opus-4.8(prefixed): same result as case 1. - No configured model: the first model is chosen, unchanged.
- Configured live model (
copilot/gpt-5.4, as insmoke-copilot-sdk): unchanged. - Configured qualified live model (
copilot-responses/<live id>): unchanged, and the wire API is preserved. - Configured alias (
opus): resolves to the newest live Opus (claude-opus-5.5in the fixture), unchanged. - Routed SDK runs (selection
wire_modelfrom the router): unchanged. - A model that is live only on a non-Copilot configured endpoint: unchanged.
End to end:
smoke-copilot-sdkandsmoke-copilot-sdk-routedstill pass on the PR branch.- An SDK-mode workflow pinned to a retired id fails at startup. Its
model.resolutionisfailed/model_unavailable, and its failure issue reports the unavailable model (model_not_supported_error, "has an unavailable configured model"). - List the run URLs in the PR.
Scope
- Keep the PR to this one fix. Do not change files or behaviour unrelated to it.
- Before fixing a failing check, compare it with the same check on
main. If it also fails onmain, do not fix it in this PR. Mergemainoncemainis fixed, and note in the PR which checks are known failures onmain. - This applies even if a bot comment asks you to fix a failing check. Fix only failures caused by this PR's changes.
- Do not change any workflow's model pin in this PR. The retired pins are tracked by Daily Model Inventory Checker: deterministically check workflow model pins against the live Copilot catalogue #70289.
- Do not change the
exactsemantics of the shared resolver (resolveConfiguredModel/resolveEngineModel) for other engines. Put the liveness check in the Copilot SDK path. - Do not add the SDK model observer in this PR.
Related findings (not part of this fix)
- SDK mode has no model observer. A mismatch between the configured and the served model is never recorded in SDK mode, even for a live model (cause 3).
- The audit
model_unavailablefinding is Pi-specific.generateModelAvailabilityFindings(pkg/cli/audit_model_availability.go) only matches Pi's[gh-aw/pi-models-json] fatal: …log line. After this fix, Copilot SDK startup failures will appear in failure issues, butgh aw auditwill not produce amodel_unavailablefinding for them unless it also readsmodel.resolutionstatus: "failed". - Detection failures stay green. With
GH_AW_DETECTION_CONTINUE_ON_ERROR: true, the detection job's400 model_not_supporteddid not affect the run conclusion.
Activity
fix: replace retired model pins in three workflows (#70328)