Skip to content

test: add tests for plugin tool execution hooks #10042

@kynnyhsap

Description

@kynnyhsap

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions