Uh oh!
There was an error while loading. Please reload this page.
feat(plugin): include parent agent context in hook inputs - #15412
feat(plugin): include parent agent context in hook inputs#15412ArmirKS wants to merge 4 commits into
Conversation
e2b243b to
e0292deComparebbo76
commented
Mar 31, 2026
any news for this ? |
This is great, one gap though: Adding it would be a small change in |
tassiocaique
commented
Apr 7, 2026
any new for this? |
50ae844 to
6bf3b18CompareThanks @bnema — I fixed the I ran into the same issue while building a plugin on my side, so having this in the hook input makes that kind of runtime handling much simpler. |
4711780 to
be63ddbCompareArmirKS
commented
Apr 13, 2026
To give more context on why this matters for plugins: right now if a subagent makes a tool call, the plugin hook only sees the current agent, not who dispatched it. That means any plugin doing delegation policy, same-model-family checks, or audit logging has to build its own tracking layer to figure out the parent-child relationship. The session layer already has this data (parentID in task.ts), this PR just passes it through. Would unblock a lot of plugin governance use cases. |
78c42da to
890b87cComparerekram1-node
commented
May 15, 2026
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Fixes#15403
Type of change
What does this PR do?
This adds
parentAgentto the plugin hook inputs that need subagent context.The main fix here is making sure that value actually survives the full prompt flow, so it reaches
tool.execute.before,tool.execute.after,shell.env,chat.params, andchat.headersconsistently.Everything is additive, so existing plugins keep working.
How did you verify your code works?
bun test test/plugin/parent-agent.test.tsbun typecheckinpackages/pluginbun typecheckinpackages/opencodeChecklist