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
loom-capture hook stores no error text for PostToolUseFailure events #1481
Version: plugin loom@loom 1.2.23, Loom 1.2.0, Claude Code on Windows 11.
What happens
When a tool call fails, the observation has the tag action:error, but its error field is empty. The record shows that a call failed, not why.
Cause
In hooks/loom-capture.mjs, buildObservation (lines 134 to 148) reads the error text only from payload.tool_response (.error, .stderr, .message). Claude Code sends the error of a PostToolUseFailure event in the top-level field payload.error; the payload has no tool_response. So errText is an empty string.
Steps to reproduce
Run a session with the plugin on.
Let the agent run a failing command, for example ls /nonexistent.
Read the row in loom.agent_events (operation='observe.record', tag action:error) and its obs:* memory. The input is there; the error text is not.
Expected
The observation holds the error text (Exit code 2 / ls: cannot access ...).
A second hook on the same events, which reads payload.error, recorded the full text for 33 of 33 failures in the same sessions.
Related gaps (for separate issues, if you want them)
The payload fields duration_ms, tool_use_id and agent_id are not stored, so durations are not known and subagent calls cannot be told apart from main calls.
The hook does not retry, so events are lost while the server restarts.
The capture hook now reads the top-level error field on PostToolUseFailure and keeps the existing tool_response fallbacks, so both event shapes record the failure text. A regression test uses the payload shape from this report: it failed with an empty error before the change and passes after. The Codex plugin copy is regenerated and both plugin manifests are bumped.
Verified locally: node --test integrations/claude-code-plugin/tests/*.test.mjs (719 tests, 0 failures), and the repository's Codex copy sync check reported the copies current.
Activity
zlareb1 commentedon Nov 25, 2026
@aniketbhoir-git would you like to fix this?
prascli commentedon Nov 25, 2026
Fixed in PR #1499: #1499
The capture hook now reads the top-level
errorfield onPostToolUseFailureand keeps the existingtool_responsefallbacks, so both event shapes record the failure text. A regression test uses the payload shape from this report: it failed with an emptyerrorbefore the change and passes after. The Codex plugin copy is regenerated and both plugin manifests are bumped.Verified locally:
node --test integrations/claude-code-plugin/tests/*.test.mjs(719 tests, 0 failures), and the repository's Codex copy sync check reported the copies current.