🤖 feat: include hook_path in tool hook responses #1887
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
When tool hooks run and produce output, the response now includes the path to the hook file that generated the output. This helps models investigate or modify the hook behavior when they receive hook feedback.
Background
Tool hooks can produce output that gets included in the tool result (e.g., formatter messages, lint errors). Previously, the model only saw the output text without knowing which file produced it. Including the hook path enables the model to:
Implementation
hook_path?: stringfield toWithHookOutputinterface insrc/common/types/tools.tsappendHookOutputfunction to accept and propagate hook paths through all result typeswithHooks.tsto pass the relevant hook pathExample output
{ "success": true, "output": "...", "hook_output": "Formatted: test.ts", "hook_duration_ms": 42, "hook_path": "/path/to/project/.mux/tool_hook" }Validation
hook_pathis correctly included in resultsGenerated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high• Cost:$0.91