Tool rows never close when PostToolUse does not fire, so agents stay permanently active

Author: BugBuster9000Created Sep 22, 2026Updated Sep 22, 2026

Describe the bug

An agent can keep a live-looking tool label forever. The JSONL parser broadcasts agentToolDone only when hooks are off. With hooks installed it deletes its own tool state and stays silent, trusting the PostToolUse hook to tell the webview.

PostToolUse does not fire for every tool. StructuredOutput is one of those. The row then stays unfinished for the life of the session.

This has two effects. The overlay shows a stale status such as Using StructuredOutput. The character also counts as working, because getActivityText returns that status rather than Idle and agentToolStart already set isActive.

Steps to reproduce

  1. Run the standalone CLI with npx pixel-agents and install the hooks.
  2. Run a Claude Code session that calls the StructuredOutput tool.
  3. Watch that agent's label in the office.

Expected behavior

The label clears once the tool finishes. The transcript records a tool_result for the call, so the completion is already known.

Actual behavior

The label stays on Using StructuredOutput indefinitely, and the agent stays active. In a workspace with many restored sessions this fills the office with stale labels.

Across my ~/.claude/projects transcripts, 36 of 36 StructuredOutput tool_use records have a matching tool_result. The parser reads them. It just never broadcasts.

Where it happens

server/src/transcriptParser.ts has two affected sites.

Site Current guard
Regular tool completion !agent.hookDelivered || useJsonlToolEvents || isCompletedAgentTool
Background spawn completion !agent.hookDelivered

Both delete activeToolIds, activeToolStatuses and activeToolNames unconditionally. Only the broadcast is skipped, so the server state is right while the client is left stale.

Suggested fix

Broadcast agentToolDone unconditionally from both sites. A repeated message is idempotent, because the webview only maps the matching toolId to done: true.

I am running this change locally. npm run test:server reports 51 failed and 491 passed both with and without it, so it adds no regressions on my machine. Those failures are pre-existing here and look Windows specific. I am happy to open a PR.

Versions

  • Pixel Agents 1.4.1, standalone CLI rather than the VS Code extension
  • Claude Code CLI 2.1.268
  • Windows 11, Node 24.19.0

Source: pixel-agents-hq/pixel-agents