Summary
The tool.execute.before and tool.execute.after plugin hooks lack test coverage. These hooks are critical for plugin developers who want to intercept and modify tool executions.
Problem
Currently, there are no automated tests verifying:
- Hooks receive correct input parameters
- Hooks can modify tool arguments (
before) and results (after)
- Hooks can throw to block execution (
before)
- Multiple hooks are called sequentially
- Edge cases like no hooks registered
Solution
Add comprehensive tests for both hooks covering all use cases.
Files to add
packages/opencode/test/plugin/tool-hooks.test.ts
Summary
The
tool.execute.beforeandtool.execute.afterplugin hooks lack test coverage. These hooks are critical for plugin developers who want to intercept and modify tool executions.Problem
Currently, there are no automated tests verifying:
before) and results (after)before)Solution
Add comprehensive tests for both hooks covering all use cases.
Files to add
packages/opencode/test/plugin/tool-hooks.test.ts