/api/agent/projects already returned model = project.modelPref for
every project, but the daemon's sync script only wrote 3 columns
(tab|dir|agent), so the model field was silently discarded between
cloud DB and local conf. _agent_launch_cmd accepts a model arg and
passes it through (codex --model, gemini -m, etc.), but the
auto-launch path in execute_inject was hardcoded to empty string.
End result: a Codex project pinned to gpt-5 still launched gpt-5.4,
a Gemini project pinned to flash launched 1.5-pro.
Three-file fix:
- sync-agent-runtime-config.py: write tab|dir|agent|model. Header
comment updated.
- agent-hook-lib.sh: _conf_agent_for_tab IFS read adds a 4th field
variable (legacy 3-col lines still work, unread field is empty).
Add _conf_model_for_tab mirror that reads the 4th column.
- cockpit-daemon.sh execute_inject auto-launch branch: look up the
conf model and pass it to _agent_launch_cmd.
Verified against a synthetic 4-col conf:
DemoProj → agent=claude model=opus
AOZ → agent=gemini model=flash
Legacy → agent=grok model=<none> (3-col line, no break)
NonExist → agent=<none> model=<none>
Not yet wired: launch_agent / switch_agent paths still take model
from queue payload only. Cloud /api/inject doesn't pass model in
payload yet either — those are the next iterations.