Cline ignores role-specific model config on launch
Context (shared across all harnesses)
AO stores a per-role model in agentConfig.model (backend/internal/domain/agentconfig.go:27). session_manager.effectiveAgentConfig merges the project base config with the role override and Spawn/Restore forward the resolved value into every adapter as cfg.Config.Model (backend/internal/ports/agent.go). Each adapter must opt in to forwarding that value to its CLI. Today only the Claude (claudecode/claudecode.go:172), Codex (#2869), and Kiro (config-file model key) adapters do. Every other adapter silently drops it, so a configured worker/orchestrator falls back to the CLI's global default model.
- Original report: #2769
- Reference fix (the pattern to copy): #2869 (Codex) — adds an
appendModelFlaghelper called in bothGetLaunchCommandandGetRestoreCommand, plus aGetConfigSpecmodelfield and regression tests.
Problem
The Cline adapter (cline, binary cline) never forwards cfg.Config.Model to the cline CLI. A Cline worker/orchestrator configured with a specific model therefore silently uses cline's global default instead.
Reproduction
- Configure a project with a
clinerole and a specific model:{ "worker": { "agent": "cline", "agentConfig": { "model": "<model-id>" } } } ao spawn --project <project> --name model-check- Open the worker session and inspect the active model.
Actual result
The worker starts on cline's global default model.
Expected result
The worker starts on the configured <model-id>.
Suspected cause
GetLaunchCommand (backend/internal/adapters/agent/cline/cline.go:59-73) and GetRestoreCommand (backend/internal/adapters/agent/cline/cline.go:108-130) build argv without reading cfg.Config.Model. The adapter also inherits the empty agentbase.Base.GetConfigSpec (agentbase/agentbase.go:20-21), so it never advertises a model field.
CLI mechanism
cline supports a launch-time model override via --model.
Source: Cline CLI reference — https://docs.cline.bot/cli/cli-reference (-m, --model <model-id>)
Suggested fix (mirror #2869)
- Add an
appendModelFlag-style helper that appends--model <trimmed model>whenstrings.TrimSpace(cfg.Config.Model) != "", and call it in bothGetLaunchCommandandGetRestoreCommand. - Override
GetConfigSpecto advertise themodelfield (ports.ConfigFieldString), matchingcodex/codex.goandclaudecode/claudecode.go:172. - Add command-construction regression tests: trimmed value present, blank omitted, restore path.
Harness note: -m is an accepted alias. Model is used with the selected provider.
References
- Reference fix: #2869 (Codex) · Original context: #2769
- Relevant file:
backend/internal/adapters/agent/cline/cline.go - Launch:
backend/internal/adapters/agent/cline/cline.go:59-73 - Restore:
backend/internal/adapters/agent/cline/cline.go:108-130
Thanks for contributing to Agent Orchestrator.
This issue is being picked up by the current external contributor on-call pair:
- @illegalcall
- @pulkit7070
If someone is already working on this, please continue as usual. The on-call pair is added for visibility, tracking, and support, not to take over the work. If you need help with review, direction, reproduction, or next steps, please tag @illegalcall and @pulkit7070 here.
For faster context or live questions, you can also join the AO Discord.
Join the session here: https://discord.gg/H6ZDcUXmq
Come by if you want to see what is being built, ask questions, or just hang around with the community.
I would like to work on this issue