Conversation
…d model defaults - Update TestCopilotDetectionDefaultModel to expect `|| 'claude-sonnet-4.6'` instead of `|| ''` - Update golden files (basic-copilot, with-imports) to include COPILOT_API_KEY env var and updated COPILOT_MODEL fallback default Agent-Logs-Url: https://github.com/github/gh-aw/sessions/77b5bfb4-f827-4c3e-8e8c-137dfb3332fb Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Smoke CI completed successfully! |
Comment Memory`````` CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing ``````Note This comment is managed by comment memory. What this comment doesIt stores persistent context for this thread in the |
There was a problem hiding this comment.
Pull request overview
Updates unit and golden tests to match recent Copilot execution-path changes: unconditional COPILOT_API_KEY injection for offline/BYOK detection and a non-empty default COPILOT_MODEL fallback (claude-sonnet-4.6).
Changes:
- Updated
TestCopilotDetectionDefaultModelexpectations to useconstants.CopilotBYOKDefaultModelin the env-var fallback expression. - Regenerated/updated golden workflow outputs to include
COPILOT_API_KEYand the newCOPILOT_MODELfallback behavior.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/threat_detection_test.go | Aligns threat-detection unit test expectations with the new default model fallback expression. |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden | Updates compiled YAML golden output to include injected COPILOT_API_KEY and updated COPILOT_MODEL fallback. |
| pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden | Updates compiled YAML golden output (with imports) to include injected COPILOT_API_KEY and updated COPILOT_MODEL fallback. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
| // Detection uses env var fallback (same pattern as main agent), allowing | ||
| // the Copilot CLI to pick its native default (currently claude-sonnet-4.6) | ||
| expectedModel: "${{ vars." + constants.EnvVarModelDetectionCopilot + " || '' }}", | ||
| expectedModel: "${{ vars." + constants.EnvVarModelDetectionCopilot + " || '" + constants.CopilotBYOKDefaultModel + "' }}", |
There was a problem hiding this comment.
The comment/docs around this assertion still say detection uses an empty-string fallback so the CLI picks its native default, but the expectation was changed to an explicit fallback model (CopilotBYOKDefaultModel). Please update the nearby comment text to match the new behavior (and ideally reference the constant rather than hard-coding a model name) to avoid misleading future readers.
| COPILOT_AGENT_RUNNER_TYPE: STANDALONE | ||
| COPILOT_API_KEY: dummy-byok-key-for-offline-mode | ||
| COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} | ||
| COPILOT_MODEL: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || '' }} | ||
| COPILOT_MODEL: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || 'claude-sonnet-4.6' }} |
There was a problem hiding this comment.
The wasm golden test compiles all fixtures under testdata/wasm_golden/fixtures (including smoke-copilot.md). The corresponding golden output (pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden) still has the old COPILOT_MODEL fallback (|| '') and is missing COPILOT_API_KEY, so TestWasmGolden_CompileFixtures is likely to keep failing. Regenerate/update that golden file as well to reflect the new injected env var and default model fallback.
🧪 Test Quality Sentinel ReportTest Quality Score: 90/100✅ Excellent test quality
Test Classification Details
Analysis SummaryThis PR makes a focused, surgical fix: two The golden test data files ( Strengths:
Minor note (-10 pts): The test assertions use Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §24847007611
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 90/100. Test quality is excellent — 0% of modified tests are implementation tests (threshold: 30%). The changes correctly sync two table-row expectations in TestCopilotDetectionDefaultModel to match the new BYOK default model behavior.
Two recent production changes to the Copilot engine execution path broke unit and golden tests that weren't updated alongside them:
COPILOT_API_KEY: dummy-byok-key-for-offline-modeis now unconditionally injected into the agent env (after all other env merges) to trigger AWF's runtime BYOK detection pathCOPILOT_MODELfallback changed from|| ''→|| 'claude-sonnet-4.6'(CopilotBYOKDefaultModel), since BYOK providers require a non-empty modelChanges
threat_detection_test.go: Update 2TestCopilotDetectionDefaultModelcases that asserted|| ''to useconstants.CopilotBYOKDefaultModelinsteadbasic-copilot.golden,with-imports.golden): Regenerate to reflect both new env vars in the compiled output: