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
{{ message }}
Repository navigation
[FEATURE]: Add messageID to tool.execute.before/after hook payloads #15933
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Description
The tool.execute.before and tool.execute.after plugin hooks currently receive { tool, sessionID, callID } in their input, but do not include messageID.
This makes it impossible for plugin authors to correlate a tool call back to the specific assistant message that triggered it. The messageID is already available in the ToolContext at every call site in packages/opencode/src/session/prompt.ts, so exposing it through the hook payload is straightforward.
Use case
When building plugins that log, audit, or post-process tool executions, you often need to group tool calls by the assistant message that initiated them. Without messageID in the hook payload, there's no way to do this — callID is unique per tool call and sessionID is too broad.
Proposed solution
Add messageID: string to the input type of both hooks in packages/plugin/src/index.ts:
These are closely related requests to extend the same hook payloads with additional context. It may be worth coordinating or consolidating these into a single broader enhancement.
These are closely related requests to extend the same hook payloads with additional context. It may be worth coordinating or consolidating these into a single broader enhancement.
thanks for the reply. I did review suggested issue but they are not perfect cover my issue/pr. so I still think my issue/pr is needed :)
Activity
github-actions commentedon Mar 4, 2026
This issue might be a duplicate of existing issues. Please check:
agentto hook input — sametool.execute.before/afterhooks, similarly proposes extending the payload with more contextparentAgentidentity in plugin hook input — same hooks, same pattern of adding more context fields to the payloadThese are closely related requests to extend the same hook payloads with additional context. It may be worth coordinating or consolidating these into a single broader enhancement.
chaomao commentedon Mar 4, 2026
thanks for the reply. I did review suggested issue but they are not perfect cover my issue/pr. so I still think my issue/pr is needed :)
github-actions commentedon Jul 5, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.