fix(agent): emit assistant events for webchat message content#27
Closed
Nachx639 wants to merge 2 commits intoopenclaw:mainfrom
Closed
fix(agent): emit assistant events for webchat message content#27Nachx639 wants to merge 2 commits intoopenclaw:mainfrom
Nachx639 wants to merge 2 commits intoopenclaw:mainfrom
Conversation
The webchat was receiving empty messages because agentCommand didn't pass the onAgentEvent callback to runCommandReply. This caused assistant text events to never be emitted, resulting in the gateway broadcasting chat events with no message content. This fix passes onAgentEvent to runCommandReply so that assistant stream events are properly emitted and the webchat receives the actual response text. 🤖 Generated with [Claude Code](https://claude.ai/claude-code) Co-Authored-By: Claude <[email protected]>
The webchat sends an idempotencyKey with chat.send requests and expects
events to arrive with that same runId. Previously, the gateway was using
the internal sessionId as runId, causing a mismatch that prevented the
webchat from correlating responses with pending requests.
Changes:
- chatRunSessions now stores {sessionKey, clientRunId} instead of just sessionKey
- Chat events use clientRunId so webchat can match them to pending promises
- Response payload includes the original clientRunId from idempotencyKey
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
520bd0a to
ead932f
Compare
Contributor
|
Appreciate the fix! I went all choa-monkey on this while working on 2.0, so this was fixed without reviewing the PR in time. |
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 2, 2026
…ategories feat(ui): add category filtering to command palette
alexprime1889-prog
pushed a commit
to alexprime1889-prog/moltbot
that referenced
this pull request
Feb 8, 2026
centminmod
added a commit
to centminmod/clawdbot
that referenced
this pull request
Feb 9, 2026
…, Attack openclaw#27, Threat #7, Hardening #12)
frodo-harborbot
pushed a commit
to harborworks/openclaw
that referenced
this pull request
Feb 16, 2026
Navbar, admin panel, and CRUD for users/orgs/members/harbors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
onAgentEventcallback torunCommandReplyinagentCommandProblem
The webchat was showing "chat timed out" or empty responses because:
agentCommandcallsrunCommandReplybut didn't pass theonAgentEventcallbackstream: "assistant") were never emittedchatRunBuffersand includes it in thechatevent withstate: "final"messagewasundefinedSolution
Pass
onAgentEventtorunCommandReplyso that assistant stream events are properly emitted:Test plan
🤖 Generated with Claude Code