Fix copilot fallback model path to use COPILOT_MODEL env var instead of --model flag#19509
Fix copilot fallback model path to use COPILOT_MODEL env var instead of --model flag#19509
Conversation
This comment has been minimized.
This comment has been minimized.
|
Hey This is a WIP draft with no code committed yet — all tasks in the checklist are still pending. Here's a summary of what remains to land this fix:
|
…model CLI flag
When engine.model is not configured, the compiler was generating
${GH_AW_MODEL_AGENT_COPILOT:+ --model "$GH_AW_MODEL_AGENT_COPILOT"} in
the shell command. The Copilot CLI does not accept --model as a flag.
Now both the explicit and fallback paths use COPILOT_MODEL env var:
- Explicit: COPILOT_MODEL: <configured-value>
- Fallback: COPILOT_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || '' }}
Also fixes TestHeredocInterpolation to check for __GH_AW__ placeholder
syntax instead of ${GH_AW_} shell syntax in prompt content.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready. |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
There was a problem hiding this comment.
Pull request overview
Fixes Copilot engine’s “fallback model” behavior by removing the invalid --model CLI flag usage and instead mapping the org-level model variables (GH_AW_MODEL_*_COPILOT) into the native COPILOT_MODEL environment variable, aligning fallback behavior with the explicit engine.model path.
Changes:
- Updated Copilot engine execution step generation to always pass the model via
COPILOT_MODEL(no--modelflag / shell expansion). - Updated/added tests to assert the new fallback mapping behavior and adjusted a heredoc interpolation assertion to match the actual placeholder syntax.
- Regenerated wasm golden outputs and updated numerous workflow lock files to reflect the new
env:layout.
Reviewed changes
Copilot reviewed 114 out of 114 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/copilot_engine_execution.go | Removes conditional --model shell expansion and maps fallback org var to COPILOT_MODEL. |
| pkg/workflow/model_env_vars_test.go | Reworks Copilot-related expectations; adds coverage for fallback mapping to COPILOT_MODEL. |
| pkg/workflow/heredoc_interpolation_test.go | Updates assertion to match __GH_AW_...__ placeholder syntax used in compiled output. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/with-imports.golden | Golden update: removes --model expansion and adds COPILOT_MODEL env mapping. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/smoke-copilot.golden | Golden update: removes --model expansion and adds COPILOT_MODEL env mapping. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/basic-copilot.golden | Golden update: removes --model expansion and adds COPILOT_MODEL env mapping. |
| .github/workflows/workflow-health-manager.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/workflow-generator.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/weekly-safe-outputs-spec-review.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/test-workflow.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/test-project-url-default.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/test-dispatcher.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/terminal-stylist.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/super-linter.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/sub-issue-closer.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/smoke-update-cross-repo-pr.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/smoke-create-cross-repo-pr.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/security-review.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/security-compliance.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/repository-quality-improver.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/repo-tree-map.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/repo-audit-analyzer.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/refiner.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/q.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/pr-triage-agent.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/pr-nitpick-reviewer.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/plan.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/pdf-summary.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/notion-issue-summary.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/metrics-collector.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/issue-triage-agent.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/grumpy-reviewer.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/gpclean.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/functional-pragmatist.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/firewall.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/example-permissions-warning.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/example-custom-error-patterns.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/dictation-prompt.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/dev.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/dependabot-go-checker.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/dependabot-burner.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/dead-code-remover.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-workflow-updater.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-team-status.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-semgrep-scan.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-secrets-analysis.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-regulatory.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-malicious-code-scan.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-cli-tools-tester.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-cli-performance.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-assign-issue-to-user.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/daily-architecture-diagram.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/craft.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/copilot-pr-merged-report.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/contribution-check.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/code-simplifier.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/code-scanning-fixer.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/ci-coach.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/brave.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/bot-detection.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/artifacts-summary.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/archie.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/agent-persona-explorer.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
| .github/workflows/agent-performance-analyzer.lock.yml | Lock update: remove --model expansion; add COPILOT_MODEL env mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Agent Container Tool Check
Result: 12/12 tools available ✅ Overall Status: PASS
|
|
Smoke Test: Copilot - 22656720591
Overall:
|
There was a problem hiding this comment.
Smoke test review ✅ — Clean simplification: using COPILOT_MODEL env var consistently removes conditional --model flag logic and eliminates duplicated sandbox/non-sandbox branches. Code is easier to read and maintain.
📰 BREAKING: Report filed by Smoke Copilot
| @@ -147,12 +147,8 @@ func (e *CopilotEngine) GetExecutionSteps(workflowData *WorkflowData, logFile st | |||
| // Build the copilot command | |||
| var copilotCommand string | |||
|
|
|||
There was a problem hiding this comment.
Nice simplification! Using COPILOT_MODEL env var consistently instead of the conditional --model flag approach makes the code much cleaner and easier to reason about.
| copilotCommand = baseCommand | ||
| } | ||
| } | ||
| // Build the command - model is always passed via COPILOT_MODEL env var (see env block below) |
There was a problem hiding this comment.
The consolidation of the sandbox/non-sandbox branches into a single command builder is a great cleanup — the old code had identical logic in both branches.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Smoke Test Results - Run §22656720599 Core: ✅ GitHub MCP · ✅ GH CLI · ✅ Make Build · ✅ Playwright · ✅ Tavily · ✅ File Write · ✅ Bash · ✅ Discussion · ✅ AW MCP Status · PR Review: ✅ Update PR · ✅ Review Comments · ✅ Submit Review · Overall: PARTIAL (core tests pass, Serena find_symbol failing)
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
When
engine.modelis not set in frontmatter, the compiler was appending${GH_AW_MODEL_AGENT_COPILOT:+ --model "$GH_AW_MODEL_AGENT_COPILOT"}to the shell command. The Copilot CLI rejects--modelas a flag entirely — onlyCOPILOT_MODELenv var is supported. This made the org-variable model path broken for every workflow not using inlineengine.model.Changes
copilot_engine_execution.goneedsModelFlagand the${VAR:+ --model "$VAR"}shell expansion entirelyCOPILOT_MODELdirectly, matching the explicit-model path:Applies to both agent (
GH_AW_MODEL_AGENT_COPILOT) and detection (GH_AW_MODEL_DETECTION_COPILOT) jobs.model_env_vars_test.goTestModelEnvVarInjectionForAgentJobandTestModelEnvVarInjectionForDetectionJob— they were asserting the broken--modelflag behaviorTestCopilotFallbackModelMapsToNativeEnvVarcovering both agent and detection job variantsheredoc_interpolation_test.go${GH_AW_in compiled output — this was only passing because the now-removed model flag expansion happened to match. The prompt content actually uses__GH_AW_...__(Handlebars placeholder syntax); updated check accordingly.Golden files & lock files
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE 64/bin/go git rev-�� pload-artifact/git/ref/tags/v7 go /usr/bin/git -json GO111MODULE 64/bin/go git(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE 64/bin/go git rev-�� pload-artifact/git/ref/tags/v7 go /usr/bin/git cli/install.sh..git GO111MODULE 64/bin/go git(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw git 64/bin/go git rev-�� --show-toplevel node(http block)https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha add origin /usr/bin/git -json GO111MODULE 64/bin/go git conf�� user.email test@example.com /usr/bin/git -json GO111MODULE 64/bin/go git(http block)/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha xterm-color sh /usr/bin/git "prettier" --wrigit git 64/bin/go git rev-�� --show-toplevel t /usr/bin/git -json GO111MODULE 64/bin/go git(http block)/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/pipx_bin/sh GOINSECURE GOMOD GOMODCACHE sh(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v3/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.0/x--jq(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE /usr/local/bin/sh GOINSECURE GOMOD GOMODCACHE sh -c "prettier" --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore GOPROXY /usr/bin/git GOSUMDB GOWORK 64/bin/go git(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json GO111MODULE 8d519d9/node_modules/.bin/prettier GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v5/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel 680605/b419/imporemote.origin.url /opt/hostedtoolcache/node/24.13.1/x64/bin/node k/gh-aw/gh-aw/scgit k/gh-aw/gh-aw/screv-parse 64/bin/go node /tmp�� /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/brave.md /opt/hostedtoolc/tmp/go-build4230178063/b395/_testmain.go /usr/bin/infocmp /tmp/go-build820git -trimpath 64/bin/go infocmp(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE ache/go/1.25.0/x--show-toplevel git(http block)https://api.github.com/repos/actions/checkout/git/ref/tags/v6/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha /tmp/gh-aw-test-runs/20260304-051859-27661/test-1833687326 config /usr/bin/git remote.origin.urgit GO111MODULE 64/bin/go git conf�� user.name Test User e/git 680605/b402/_pkggit GO111MODULE 64/bin/go e/git(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --get remote.origin.url 28142ea28640e73dbec04231d8c86d181a13e84c1c94ebff59b1e2ac8c81ae04-d 80bf13b2620176ebgit GO111MODULE 64/bin/go git init�� erignore 98SOCpl_QrR0 ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet 680605/b384/_pkggit GO111MODULE 64/bin/go ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� pload-artifact/git/ref/tags/v7 go /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git(http block)https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha g_.a GO111MODULE 64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/link env tutil.test g/envutil/envutil_test.go ortcfg.link GOINSECURE GOMOD GOMODCACHE _hV3O2Cg4KalLpCxFj/loOf-cgjR6MKz0XVD7GS/mRL0tEU7JbrieQ94-F8q(http block)/usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha s "-s -w -X main.version=421b3d4-dirty" -o gh-aw ./cmd/gh-aw GO111MODULE .cfg GOINSECURE GOMOD GOMODCACHE go env 1859-27661/test-2066814382 GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go ache�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha g/logger/exampleGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 680605/b398/_pkgGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha a1e46e74a3655a0aGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD ode-gyp-bin/sh ache/go/1.25.0/xGO111MODULE env 680605/b414/_pkgGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/time-atomic GOMODCACHE go(http block)https://api.github.com/repos/actions/setup-go/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /tmp/gh-aw-test-runs/20260304-051859-27661/test-9683608 0178063/b428/_testmain.go /usr/bin/git g/cli/access_loggit g/cli/actionlintrev-parse 64/bin/go git rev-�� --show-toplevel ache/go/1.25.0/xGO111MODULE e/git 680605/b357/_pkggit GO111MODULE 64/bin/go e/git(http block)/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /tmp/gh-aw-test-runs/20260304-052013-40176/test-3356202311/.github/workflows rev-parse /usr/bin/git --write **/*.cjs 64/bin/go git rev-�� --show-toplevel node /usr/bin/git prettier --write modules/@npmcli/--show-toplevel git(http block)/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha -json GO111MODULE ache/node/24.13.1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh GOINSECURE GOMOD GOMODCACHE go env ck 'scripts/**/*.js' --ignore-path .prettierignore GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/setup-node/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel -extld=gcc /usr/bin/git 92621063164b9cfcgit GO111MODULE 64/bin/go git conf�� --get remote.origin.url /usr/bin/git 680605/b354/_pkggit GO111MODULE 64/bin/go git(http block)/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel node /usr/bin/git --write **/*.cjs 64/bin/go git rev-�� s/test.md node /usr/bin/git prettier --write 64/bin/go git(http block)/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -json GO111MODULE es/.bin/sh GOINSECURE GOMOD GOMODCACHE go env ck 'scripts/**/*.js' --ignore-path .prettierignore GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha -json GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE go t-ha�� ithub/workflows/agent-persona-explorer.md GO111MODULE .cfg GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha ck 'scripts/**/*.js' --ignore-path .prettierignore GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /home/REDACTED/work/gh-aw/gh-aw/node_modules/.bin/node GOINSECURE GOMOD GOMODCACHE node(http block)/usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE tions/setup/js/node_modules/.bin/node GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7/usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/link env aw.test GO111MODULE ortcfg.link GOINSECURE GOMOD GOMODCACHE PXIu3Rj7Nwxxi7Q9ca/ny1RJv3hXd3Qzku74ENl/Ap7TMFO4--jq(http block)https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b/usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha --show-toplevel infocmp ache/go/1.25.0/x64/bin/node xterm-color git n-dir/bash git ache�� --show-toplevel nly /usr/bin/git --show-toplevel git n-dir/bash git(http block)https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/bin/sh GOINSECURE GOMOD GOMODCACHE go env archie.md GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts/usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go estl�� -json GO111MODULE x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link(http block)/usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD(http block)https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go estl�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts/usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE 1/x64/bin/sh GOINSECURE GOMOD GOMODCACHE go env .js' --ignore-path .prettierignore GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts/usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env .js' --ignore-path .prettierignore GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts/usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE de/node/bin/sh GOINSECURE GOMOD GOMODCACHE go env .js' --ignore-path .prettierignore GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts/usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env .js' --ignore-path .prettierignore GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/actions/workflows/usr/bin/gh gh workflow list --json name,state,path heck '**/*.cjs' GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ck 'scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.13.1/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git sh git(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE At,event,headBranch,headSha,displayTitle GOINSECURE GOMOD GOMODCACHE go env 3257218178/.github/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha ath ../../../.pr**/*.json !../../../pkg/wo--ignore-path 64/bin/go ../../../.pretti/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet go /usr/bin/git go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha "prettier" --wriGOINSECURE git 64/bin/go uest|push_to_pulnode go 86_64/node sh -c npx prettier --w**/*.ts git 64/bin/go --show-toplevel go /usr/bin/git go(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha "prettier" --wriGOSUMDB git 64/bin/go rror go /usr/bin/git go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha e=false GO111MODULE 64/bin/go GOINSECURE %H %ct %D GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha 680605/b392/_pkgGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/envu-atomic GOMODCACHE go env v2pU/RWquzQgp_1Y-errorsas GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 680605/b392/imporev-parse(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha 680605/b393/_pkgGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env XWML/sJ2GQWlxnpa-errorsas GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 680605/b393/impo-tests(http block)https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha ath ../../../.pr**/*.json ../../../**/*.js--ignore-path 64/bin/go --ignore-path ../../../.pretti-atomic /usr/bin/git go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/githubnext/agentics/git/ref/tags//usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git 64/pkg/tool/linux_amd64/vet git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git --show-toplevel git ache/go/1.25.0/xgraphql git(http block)https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha ath ../../../.pr**/*.json ../../../**/*.js--ignore-path 64/bin/go --ignore-path ../../../.pretti-atomic /usr/bin/git go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha "prettier" --wriGOINSECURE git 64/bin/go --show-toplevel go /usr/bin/git sh -c npx prettier --w**/*.ts git 64/bin/go --show-toplevel go /usr/bin/git dependencies."(http block)https://api.github.com/repos/nonexistent/repo/actions/runs/12345/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go env " GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)https://api.github.com/repos/owner/repo/actions/workflows/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go --show-toplevel go /usr/bin/gh sh -c npx prettier --wGOSUMDB gh 64/bin/go /repos/actions/ush --jq /usr/bin/git go(http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go --show-toplevel go 64/bin/node sh -c npx prettier --wGOSUMDB git 64/bin/go --show-toplevel go /usr/bin/infocmp"prettier" --check 'scripts/**/*.js' --ignore-path .prettierignore go(http block)https://api.github.com/repos/owner/repo/contents/file.md/tmp/go-build4230178063/b383/cli.test /tmp/go-build4230178063/b383/cli.test -test.testlogfile=/tmp/go-build4230178063/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE rtcfg k/gh�� ternal/tools/genGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD erignore ache/go/1.25.0/xGO111MODULE(http block)/tmp/go-build35402538/b383/cli.test /tmp/go-build35402538/b383/cli.test -test.testlogfile=/tmp/go-build35402538/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true --show-toplevel 64/pkg/tool/linuenv run-script/lib/n-json sh -c "prettier" --wriGOINSECURE git de "; \ else \ echo "��� Warning: .github/aw/actions-lock.json does not exist yet"; \ fi dwFO3cBOLj36ZOwl-w /usr/bin/git node(http block)https://api.github.com/repos/test-owner/test-repo/actions/secrets/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ck 'scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go(http block)/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name prettier --write 64/bin/go **/*.ts **/*.json --ignore-path node /opt�� run format:pkg-json 64/bin/go xterm-color go /usr/bin/git go(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Copilot engine fallback model path uses --model CLI flag instead of COPILOT_MODEL env var</issue_title>
<issue_description>## What happens
When
engine.modelis not explicitly configured in workflow frontmatter, the compiler generates a shell command that conditionally appends--model "$GH_AW_MODEL_AGENT_COPILOT"as a CLI flag to the Copilot CLI invocation. The Copilot CLI does not accept--modelas a flag — it errors withargument '<model>' is invalid.When
engine.modelis configured, the compiler correctly sets theCOPILOT_MODELenvironment variable, which the Copilot CLI reads natively. So the "explicit model" path works, but the "fallback from GitHub org variable" path is broken.The test suite contains contradictory expectations: one test expects the
--modelflag to appear, while another asserts it should NOT appear.What should happen
Both code paths should use
COPILOT_MODELas an environment variable. When the model comes from a GitHub org variable (GH_AW_MODEL_AGENT_COPILOT), the compiler should map it toCOPILOT_MODELin the step'senv:block rather than appending it as a CLI flag.Where in the code
All references are to
mainat99b2107.Path selection:
copilot_engine_execution.go:78—modelConfigured := workflowData.EngineConfig != nil && workflowData.EngineConfig.Model != ""determines which path is takenBroken fallback path (no explicit model):
copilot_engine_execution.go:154—needsModelFlag := !modelConfiguredcopilot_engine_execution.go:182-183— sandbox mode: generates${GH_AW_MODEL_AGENT_COPILOT:+ --model "$GH_AW_MODEL_AGENT_COPILOT"}copilot_engine_execution.go:191-192— non-sandbox mode: same--modelflag expansioncopilot_engine_execution.go:312-318— setsGH_AW_MODEL_AGENT_COPILOTorGH_AW_MODEL_DETECTION_COPILOTin env block (the value source is correct, but it's consumed as a CLI flag)Correct explicit-model path:
copilot_engine_execution.go:309-311—env[constants.CopilotCLIModelEnvVar] = workflowData.EngineConfig.Model— setsCOPILOT_MODELdirectlyContradictory tests:
model_env_vars_test.go:21-25— expects--modelflag in shell command (tests the broken behavior)model_env_vars_test.go:213-243— asserts--modelflag should NOT appear whenCOPILOT_MODELenv var is usedEvidence
Source-level verification (2026-03-03):
mainneedsModelFlagistrueexactly whenmodelConfiguredisfalse${GH_AW_MODEL_AGENT_COPILOT:+ --model "$GH_AW_MODEL_AGENT_COPILOT"}will pass--model gpt-5(or whatever value) as a positional argument to the Copilot CLICopilot CLI verification (v0.0.421):
copilot --model gpt-5 --prompt 'say hi'fails withargument 'gpt-5' is invalidCOPILOT_MODEL=gpt-5 copilot --prompt 'say hi'runs normally--modelas a flag; the env var is the only supported mechanismRelated issue: #17265 (closed) requested the model be provided via env var. The fix was applied for the explicit-model path (
COPILOT_MODELenv var) but the fallback path was missed and still uses the broken--modelflag.Proposed fix
In
copilot_engine_execution.go, whenneedsModelFlagis true, instead of generating${GH_AW_MODEL_AGENT_COPILOT:+ --model "$GH_AW_MODEL_AGENT_COPILOT"}in the shell command, map the org variable toCOPILOT_MODELin the step'senv:block:Remove the
needsModelFlag/--modelflag expansion frombuildCopilotCommand()entirely. Update the contradictory test atmodel_env_vars_test.go:21-25to expectCOPILOT_MODELin the env block instead of--modelin the command string.Impact
Frequency: Affects every workflow run where the model is configured via GitHub org variables (
GH_AW_MODEL_AGENT_COPILOT/GH_AW_MODEL_DETECTION_COPILOT) rather than inlineengine.modelfrontmatter. This is the default path for repos that don't customize per-workflow.Cost: The
--modelflag produces a hard error from the Copilot CLI. If the org variable is set, the run fails immediately. If the org variable is unset, the conditional expansion is a no-op and the default model is used — so the bug is latent until someone configures the org variable.</issue_description>Comments on the Issue (you are @copilot in this section)
@pelikhan Use COPILOT_MODEL✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
✨ PR Review Safe Output Test - Run 22656720599