Skip to content

Treat an empty expression-based engine.model as omitted #46499

Description

@jeffhandley

Summary

A workflow-specific model override cannot currently be optional when engine.model is backed by a GitHub Actions variable. If the variable is unset, the expression resolves to an empty string, but gh-aw still propagates that empty value as the engine model. The Copilot engine requires a non-empty model value, so the variable becomes mandatory instead of falling back to normal model resolution.

Minimal reproduction

engine:
  id: copilot
  model: ${{ vars.HOLISTIC_REVIEW_MODEL }}

Compile with gh-aw v0.82.6:

gh aw compile holistic-review --validate --schedule-seed dotnet/runtime

The generated workflow contains:

COPILOT_MODEL: ${{ vars.HOLISTIC_REVIEW_MODEL }}

When HOLISTIC_REVIEW_MODEL is not defined, GitHub Actions resolves it to an empty string. That empty model value is passed through rather than treated as if engine.model had been omitted.

Expected behavior

When an expression-backed engine.model resolves to an empty string, gh-aw should treat the value as omitted and use its normal Copilot model resolution (GH_AW_MODEL_AGENT_COPILOT, GH_AW_DEFAULT_MODEL_COPILOT, then the compiler/runtime default).

This would allow a workflow-specific override to be optional without embedding a model identifier that can later become unavailable.

Actual behavior

The empty value is propagated to the engine, so the workflow-specific variable must always be configured.

Workarounds

Either:

  1. Define the variable in every repository/environment where the workflow runs, or
  2. Put a hard-coded fallback in workflow source, which can become stale when model availability changes.

Note

This issue was drafted with GitHub Copilot on behalf of the reporter.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions