Bug
When passing a model alias (e.g. gpt, sonnet, gemini-pro) to sessions_spawn's model parameter, the alias is not resolved to the full provider/model ref. The subagent silently falls back to the default model.
Steps to Reproduce
- Configure aliases in
agents.defaults.models:
"openai-codex/gpt-5.4": {"alias": "gpt"}
- Call
sessions_spawn with model: "gpt"
- The subagent runs on the default/fallback model, not GPT
Expected Behavior
The alias should resolve to the full model ref (openai-codex/gpt-5.4) before patching the child session, consistent with how /model gpt works in slash commands.
Root Cause
normalizeModelSelection() in reply-*.js just trims the string and returns it. It does not perform a reverse lookup against the agents.defaults.models alias map. Since the trimmed alias string is truthy, it short-circuits the rest of the resolution chain in resolveSubagentSpawnModelSelection().
The patched session receives a raw alias string that the gateway cannot match to a real provider/model pair, so it falls back to the default.
Workaround
Pass full model refs instead of aliases:
openai-codex/gpt-5.4 instead of gpt
anthropic/claude-sonnet-4-5 instead of sonnet
google-gemini-cli/gemini-3-pro-preview instead of gemini-pro
Suggested Fix
Add reverse alias resolution in normalizeModelSelection() or resolveSubagentSpawnModelSelection() before returning the model string. The alias map is already available in cfg.agents.defaults.models.
Bug
When passing a model alias (e.g.
gpt,sonnet,gemini-pro) tosessions_spawn'smodelparameter, the alias is not resolved to the full provider/model ref. The subagent silently falls back to the default model.Steps to Reproduce
agents.defaults.models:sessions_spawnwithmodel: "gpt"Expected Behavior
The alias should resolve to the full model ref (
openai-codex/gpt-5.4) before patching the child session, consistent with how/model gptworks in slash commands.Root Cause
normalizeModelSelection()inreply-*.jsjust trims the string and returns it. It does not perform a reverse lookup against theagents.defaults.modelsalias map. Since the trimmed alias string is truthy, it short-circuits the rest of the resolution chain inresolveSubagentSpawnModelSelection().The patched session receives a raw alias string that the gateway cannot match to a real provider/model pair, so it falls back to the default.
Workaround
Pass full model refs instead of aliases:
openai-codex/gpt-5.4instead ofgptanthropic/claude-sonnet-4-5instead ofsonnetgoogle-gemini-cli/gemini-3-pro-previewinstead ofgemini-proSuggested Fix
Add reverse alias resolution in
normalizeModelSelection()orresolveSubagentSpawnModelSelection()before returning the model string. The alias map is already available incfg.agents.defaults.models.