Description
Why
Picking Cursor GPT-5.6 Sol (or any Cursor model) still lets the Task tool fan out to Composer / Sonnet. Sol is a model pick, not a crew. The parent session is already on --model gpt-5.6-sol-high-fast; Task then fills an explicit model of composer-2.5 or claude-sonnet-5-thinking-high.
Follow-up to #685 (card titles). That made the fan-out visible. This stops it.
Policy
On every Cursor thread (not Sol-only):
- generalPurpose Task / Agent workers inherit the parent model (strip Task
modelso Cursor inherit applies) - built-in explore / bash / browser / shell subagents keep their own model (fast search is fine)
Do not write into the user's ~/.cursor or the project .cursor/hooks.json (that would hit Cursor IDE and dirty the repo).
How
cursor-agent has --plugin-dir. Ship a tiny Cursor plugin that Solenta materializes onto a real filesystem path (userDataPath), then pass --plugin-dir on spawn. Package copies only electron/*.js (see scripts/package-app.sh), so do not leave the hook only as a subdirectory inside asar: embed or copy it out at runtime.
Hook: preToolUse matcher Task|Agent. updated_input deletes model when it is not inherit and not the parent (model / model_id on the hook payload). Omitting the field is more reliable on CLI than setting inherit. subagentStart can only deny, not rewrite; prefer rewrite.
Tests
- unit: hook stdin/stdout for foreign model, matching parent, inherit, explore left alone
- runner: argv includes
--plugin-dirand the prompt stays last; passuserDataPathin that test - existing cursor tests stay green
Out of scope
Forcing Cursor's Task tool off entirely. Prompt-only rules.
Activity
currentbits commentedon Aug 23, 2026
Landed on worker branch
coder/fork-i-think-there-is-something-wrong-wi-733813(d26cd1c). Not merged.What landed
Solenta now materializes a tiny Cursor plugin at runtime and passes
--plugin-diron every localcursor-agentspawn.<userDataPath>/cursor-pin-parent(tests withoutuserDataPathfall back to tmpdir). Package still copies onlyelectron/*.js, so the plugin is written onto a real filesystem path rather than living under asar.preToolUsematcherTask|Agent. If the call is generalPurpose (or unspecified) andtool_input.modelis a non-empty string other thaninheritand other than the parentmodel/model_id, that field is deleted so Cursor inherit applies. Omitting the field, not settinginherit.explore/bash/browser/shellkeep their own model.{ permission: "allow" }and exit 0.~/.cursor/hooks.jsonor the project's.cursor/hooks.json.--worktree. No settings UI; always-on for local Cursor threads. SSH/WSL spawns skip--plugin-dirbecause the plugin path is on this host.Tests:
node --test electron/test/cursor.test.js electron/test/cursor-parse.test.js electron/test/cursor-pin-task-parent.test.js(40 pass).How to verify
composer-2.5orclaude-sonnet-5-thinking-high.Task.modelSol asked for, the card can still name that model even though the worker inherited. The spawn is the check.nodemust be on PATH; the hook isnode <abs script>. Electron's own binary cannot run it.Explore/bash/browser/shell Task cards can still show their own model. That is intended.
currentbits commentedon Aug 23, 2026
Landed on main (merge of coder/fork-i-think-there-is-something-wrong-wi-733813). Local Cursor Task/Agent workers inherit the parent model; explore/bash/browser/shell keep their own.