You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run a lot of read-only exploration through the agent tool, but every sub-agent call has to go through the global large slot — very inconvenient and hard on the bill.
The TODO at internal/agent/coordinator.go ("when we support multiple agents we need to change this so that we pass in the agent specific model config") suggests this was on the roadmap. I'd like to tackle this in three steps, starting with the safest one:
Step 1 (implemented, ready for PR): predefined sub-agents with pinned models.
The agents config section is now actually read (it was json:"-"), merged over the built-in coder/task defaults. User entries override built-ins or add custom sub-agents; custom agents default to read-only tools + no MCPs unless configured otherwise.
An agent's model field still accepts large/small, but also accepts a pinned "provider/model" like "model": "zhipu/glm-5".
The agent tool gains an optional agent parameter (defaults to task), and its description lists the available sub-agents with their resolved models, so the main agent can pick at runtime.
So I can define explore-cheap and explore-heavy with the same purpose pinned to different models and let the main agent route between them. task itself can also have its model overridden in config to move off the default slot. The coder's pinned model currently gets reset by UpdateModels before each run (it re-reads the global slots); I want to fix that next, and I'll open an MR for it if the team is open.
Config shape borrows from opencode's per-agent model: "provider/model-id" (crush's sibling project; the closest prior art I found — fantasy and catwalk don't have sub-agent concepts).
Step 2 (near-term): runtime model parameter.
Predefined sub-agents solve the "same purpose, different price point" problem, but adding a new one means editing the config file. What I want next is for the main agent to pass model: "provider/model" at call time instead of predefining everything. Implementation-wise this can follow the pattern of crush's own agentic_fetch tool: it builds a temporary sub-agent on each call, uses it once, and discards it instead of pre-building and reusing. The change is smaller than step 1.
Step 3 (long-term): Claude Code-style background sub-agent execution.
Currently runSubAgent is synchronous: the main agent's tool call blocks until the sub-agent finishes. Claude Code supports background sub-agents where the main agent keeps working and the result is injected later. This requires async-ifying runSubAgent, which is a bigger change that likely touches the session state machine and the nested tool rendering in the UI. This is the feature I want most, but I think it should wait until steps 1 and 2 are stable.
Happy to open a PR for step 1 if the team is open to the design; also happy to hear early directional feedback on steps 2 and 3.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I run a lot of read-only exploration through the
agenttool, but every sub-agent call has to go through the global large slot — very inconvenient and hard on the bill.The TODO at
internal/agent/coordinator.go("when we support multiple agents we need to change this so that we pass in the agent specific model config") suggests this was on the roadmap. I'd like to tackle this in three steps, starting with the safest one:Step 1 (implemented, ready for PR): predefined sub-agents with pinned models.
agentsconfig section is now actually read (it wasjson:"-"), merged over the built-in coder/task defaults. User entries override built-ins or add custom sub-agents; custom agents default to read-only tools + no MCPs unless configured otherwise.modelfield still acceptslarge/small, but also accepts a pinned"provider/model"like"model": "zhipu/glm-5".agenttool gains an optionalagentparameter (defaults totask), and its description lists the available sub-agents with their resolved models, so the main agent can pick at runtime.So I can define
explore-cheapandexplore-heavywith the same purpose pinned to different models and let the main agent route between them. task itself can also have itsmodeloverridden in config to move off the default slot. The coder's pinned model currently gets reset byUpdateModelsbefore each run (it re-reads the global slots); I want to fix that next, and I'll open an MR for it if the team is open.Config shape borrows from opencode's per-agent
model: "provider/model-id"(crush's sibling project; the closest prior art I found — fantasy and catwalk don't have sub-agent concepts).Step 2 (near-term): runtime
modelparameter.Predefined sub-agents solve the "same purpose, different price point" problem, but adding a new one means editing the config file. What I want next is for the main agent to pass
model: "provider/model"at call time instead of predefining everything. Implementation-wise this can follow the pattern of crush's ownagentic_fetchtool: it builds a temporary sub-agent on each call, uses it once, and discards it instead of pre-building and reusing. The change is smaller than step 1.Step 3 (long-term): Claude Code-style background sub-agent execution.
Currently
runSubAgentis synchronous: the main agent's tool call blocks until the sub-agent finishes. Claude Code supports background sub-agents where the main agent keeps working and the result is injected later. This requires async-ifyingrunSubAgent, which is a bigger change that likely touches the session state machine and the nested tool rendering in the UI. This is the feature I want most, but I think it should wait until steps 1 and 2 are stable.Happy to open a PR for step 1 if the team is open to the design; also happy to hear early directional feedback on steps 2 and 3.
All reactions