Problem
expandPrompt: true substitutes $VAR tokens from vars steps into the prompt text at runtime. The same substitution is not available for other agent step fields: model, agent, and command.
This means a workflow param for model selection (equivalent to --model in the shell scripts) cannot be threaded into the model: field — it must be hardcoded. Users who want to run the same workflow with different models must either edit the YAML or maintain separate workflow copies.
Proposed feature
Extend the existing expandPrompt mechanism to cover other string fields on agent steps, either via a broader flag or field-by-field:
Option A — single flag covering all expandable fields:
- type: agent
expandFields: true # expands model:, agent:, command:, prompt:
model: $MODEL
prompt: |
...
Option B — explicit per-field opt-in (mirrors expandPrompt pattern):
- type: agent
expandPrompt: true
expandModel: true
model: $MODEL
prompt: |
...
Option A is simpler and consistent with how expandPrompt already works.
Generated bash
Without the feature, model is hardcoded:
opencode run --model 'gpt-4o' "$_prompt"
With expandFields: true and MODEL set via param or vars:
opencode run --model "$MODEL" "$_prompt"
Why nice to have
The workaround — hardcode the model in the YAML — is intentional and explicit. It is only inconvenient when the same workflow needs to be run repeatedly with different models without editing the file each time.
Problem
expandPrompt: truesubstitutes$VARtokens fromvarssteps into theprompttext at runtime. The same substitution is not available for other agent step fields:model,agent, andcommand.This means a workflow
paramfor model selection (equivalent to--modelin the shell scripts) cannot be threaded into themodel:field — it must be hardcoded. Users who want to run the same workflow with different models must either edit the YAML or maintain separate workflow copies.Proposed feature
Extend the existing
expandPromptmechanism to cover other string fields on agent steps, either via a broader flag or field-by-field:Option A — single flag covering all expandable fields:
Option B — explicit per-field opt-in (mirrors expandPrompt pattern):
Option A is simpler and consistent with how
expandPromptalready works.Generated bash
Without the feature, model is hardcoded:
With
expandFields: trueandMODELset via param orvars:Why nice to have
The workaround — hardcode the model in the YAML — is intentional and explicit. It is only inconvenient when the same workflow needs to be run repeatedly with different models without editing the file each time.