opencode
opencode copied to clipboard
add command.execute.before hook + allow parallel subtasks + fix model inheritance
This PR
- Fixes model inheritance issues around subtasks, allows for parallel subtasks and add a new command hook
- Gives more powers to slash commands (and lifts current limitations)
- Merges 6411 and 5726 for simplicity and cohesion sake
Example
With a plugin, it could enable slash commands to spawn multiple parallel subagents, each with their own model
(new frontmatter params are not part of this PR, but handled with subtask2 plugin)
And many more use cases... some of which are documented in subtask2
Code changes
- feat: Parallel subtask execution for slash-commands.
- feat: Model inheritance for subtasks (Command Frontmatter > Agent > Session > Default).
- feat: Added command.execute.before plugin hook.
- fix: Restored parent session context (agent/model) after subtask completion.
Note
The diff algo on github makes this PR look bigger than it really is :/ in my IDE it looks simpler to review