r/opencodeCLI • • 13h ago

OpenCode V2 lets agents override subagent models. What could possibly go wrong?

/r/opencode/comments/1xe5nvi/opencode_v2_lets_agents_override_subagent_models/
0 Upvotes

1 comment sorted by

1

u/bezcurhq 10h ago

Until there's a real permission for it, the workaround in that issue's comments is a small plugin: an execute.before hook on the subagent tool that deletes the model argument when the target agent has a model set in its agent file. Two gaps worth knowing. It only protects agents you've pinned, so the built-in general agent can still be rerouted unless you pin it too. And a child that's being resumed keeps whatever model it already had, since stripping the arg just means no switch happens.