opencode icon indicating copy to clipboard operation
opencode copied to clipboard

add command.execute.before hook + allow parallel subtasks + fix model inheritance

Open spoons-and-mirrors opened this issue 3 weeks ago • 1 comments

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) image

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

spoons-and-mirrors avatar Dec 30 '25 21:12 spoons-and-mirrors