openclaw - 💡(How to fix) Fix claude-cli backend: tool_use events not surfaced via onAgentEvent (iMessage / webchat see no stream:tool) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#75846Fetched 2026-05-02 05:29:08
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
commented ×1cross-referenced ×1

Root Cause

Root cause The claude-cli JSONL parser receives tool_use entries from the CLI, but they aren't threaded through to onAgentEvent. The emit path that pi-embedded uses isn't shared.

Fix Action

Fix / Workaround

Workaround We've been running a local runtime patch since 2026-04-29 that bridges the events. Happy to clean up and PR if it'd help.

RAW_BUFFERClick to expand / collapse

Symptom When a session is routed through the claude-cli backend, downstream consumers that subscribe to stream:tool events (the iMessage monitor, webchat UI) see nothing while tools are executing. The pi-embedded surface gets the same events through a different code path, so the gap is asymmetric across surfaces.

Root cause The claude-cli JSONL parser receives tool_use entries from the CLI, but they aren't threaded through to onAgentEvent. The emit path that pi-embedded uses isn't shared.

Suggested fix In the claude-cli JSONL parser's tool_use branch, emit a stream:tool event through onAgentEvent with the same shape pi-embedded uses ({ type, name, args, callId }).

Affected dist files (post-build globs)

  • claude-live-session-*.js
  • execute.runtime-*.js
  • agent-runner.runtime-*.js

Workaround We've been running a local runtime patch since 2026-04-29 that bridges the events. Happy to clean up and PR if it'd help.

extent analysis

TL;DR

Emit a stream:tool event through onAgentEvent in the claude-cli JSONL parser's tool_use branch to fix the asymmetric event delivery issue.

Guidance

  • Verify that the tool_use entries are being correctly received by the claude-cli JSONL parser and that the onAgentEvent function is properly defined and accessible.
  • Update the tool_use branch in the claude-cli JSONL parser to emit a stream:tool event with the required shape ({ type, name, args, callId }) to match the pi-embedded emit path.
  • Test the fix by checking that downstream consumers (e.g., iMessage monitor, webchat UI) receive the expected stream:tool events when tools are executing.
  • Consider applying the local runtime patch as a temporary workaround until the fix is fully implemented and verified.

Example

No code snippet is provided as the issue does not contain sufficient code context.

Notes

The suggested fix assumes that the onAgentEvent function is correctly implemented and can handle the emitted stream:tool event. Additional testing and verification may be necessary to ensure the fix works as expected.

Recommendation

Apply the suggested fix by updating the claude-cli JSONL parser's tool_use branch to emit the stream:tool event, as this addresses the root cause of the issue and provides a permanent solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix claude-cli backend: tool_use events not surfaced via onAgentEvent (iMessage / webchat see no stream:tool) [1 comments, 2 participants]