Fix imported engine.model silently dropped when max-ai-credits is set - #48482
Conversation
…is set
When a main workflow set max-ai-credits at the top level (creating a
non-nil engineConfig from budget fields alone) and an imported file
provided engine: { id: ..., model: ... }, the model was silently
discarded. The extraction branch in resolveEngineFromIncludesAndImports
was guarded by `engineConfig == nil`, so when engineConfig was non-nil
the imported model was never read.
Fix: add an else-if branch that extracts just the model from the first
imported engine config when model is still empty and engineConfig is
already non-nil.
Adds a regression test that covers the exact scenario from the issue
report: max-ai-credits: 1500 in the main workflow + engine.model in
an imported shared workflow.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis. |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ PR Code Quality Reviewer completed the code quality review. |
There was a problem hiding this comment.
Pull request overview
Fixes imported engine model pins being dropped when top-level AI credit limits create a partial engine configuration.
Changes:
- Preserves imported
engine.modelvalues. - Adds regression coverage for
max-ai-credits. - Refreshes the generated smoke workflow lock.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/compiler_orchestrator_engine.go |
Extracts the imported model when needed. |
pkg/workflow/compiler_orchestrator_engine_test.go |
Tests model and budget preservation. |
.github/workflows/smoke-copilot-auto.lock.yml |
Refreshes generated model-cost metadata. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Medium
|
@copilot resolve the merge conflicts on this branch. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Resolved. I merged |
When a workflow sets
max-ai-creditsat the top level and sourcesengine.modelfrom an import, the model pin is silently discarded — the compiled lock falls back to${{ vars.GH_AW_MODEL_AGENT_COPILOT || ... }}with zero compiler warnings.Root cause
max-ai-creditsat the top level causesExtractEngineConfigto return a non-nilengineConfig(to carry the budget). InresolveEngineFromIncludesAndImports, model extraction fromallEngineswas gated onengineConfig == nil, so a budget-onlyengineConfigcaused the import'sengine.modelto be skipped entirely. TheapplyEngineImportDefaultspath that handlesMergedEngineModelis not exercised here because an engine with anidgoes intoMergedEngines, notMergedEngineModel.Fix
compiler_orchestrator_engine.go— add anelse ifbranch inresolveEngineFromIncludesAndImportsthat extracts the model fromallEngines[0]whenmodel == ""andengineConfig != nil:compiler_orchestrator_engine_test.go— regression testTestSetupEngineAndImports_ImportedModelPreservedWithTopLevelMaxAICreditscovering the exact failure scenario:max-ai-credits: 1500in the main workflow +engine: { id: copilot, model: gpt-5.6-sol }in an import.