openclaw - 💡(How to fix) Fix TUI does not render externally-injected user turns (e.g. via a wake-socket transport) even though they land in the conversation transcript [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#84113Fetched 2026-05-20 03:43:58
View on GitHub
Comments
1
Participants
2
Timeline
12
Reactions
1
Timeline (top)
labeled ×8cross-referenced ×3commented ×1

Externally injected user turns can land in the active conversation transcript and trigger a model response, but openclaw-tui does not render the synthetic user turn in the live chat log. For wake-socket style transports, the operator sees the assistant response without the cross-agent/operator message that caused it.

Root Cause

Externally injected user turns can land in the active conversation transcript and trigger a model response, but openclaw-tui does not render the synthetic user turn in the live chat log. For wake-socket style transports, the operator sees the assistant response without the cross-agent/operator message that caused it.

Fix Action

Fix / Workaround

  • dist/tui-*.js: ChatLog.addUser(text) and UserMessageComponent are the existing user-message render path.
  • dist/tui-*.js: the gateway event dispatch currently handles chat, chat.side_result, and agent.
  • dist/server.impl-*.js: EVENT_SCOPE_GUARDS drops unlisted events, so a new event must be explicitly scoped for operator read clients.
  • dist/claude-live-session-*.js: an external wake/socket injection point can write a stream-json user input to the active Claude live-session stdin.
  1. Emit an in-process event from the injection point only after stdin write succeeds and the wake/inbox record is marked consumed.
  2. Broadcast that event over the existing gateway WebSocket channel as wake.injected.
  3. Add wake.injected to EVENT_SCOPE_GUARDS with operator read scope.
  4. Let TUI subscribe through its existing client.onEvent dispatch, filter to the active session, dedupe by wake id or session/timestamp/text hash, and call the existing ChatLog.addUser(text, opts) path.
  5. Render synthetic user turns with a small source badge such as [via wake-socket], while preserving identical rendering for normal operator-typed messages.

Local Interim Patch

Code Example

{
  "schema": "openclaw.wake.injected.v1",
  "source": "titus-wake-socket",
  "wake_id": "string-or-null",
  "sessionKey": "agent:titus:main",
  "sessionId": "claude-session-id-or-null",
  "text": "operator-visible wake message",
  "wake_file_path": "/path/to/wake.json",
  "consumed_at": "ISO-8601 timestamp",
  "consumed_by_run_id": "openclaw-gateway:<pid>:<session>",
  "injected_bytes": 1234
}
RAW_BUFFERClick to expand / collapse

Summary

Externally injected user turns can land in the active conversation transcript and trigger a model response, but openclaw-tui does not render the synthetic user turn in the live chat log. For wake-socket style transports, the operator sees the assistant response without the cross-agent/operator message that caused it.

Impact

This creates an observability gap for multi-agent or wake-driven workflows:

  • The model receives and responds to the injected user turn.
  • The transcript remains the source of truth.
  • The live TUI omits the synthetic user turn, so the operator loses message visibility and cannot easily tell why the assistant started responding.

Relevant Code Surface

  • dist/tui-*.js: ChatLog.addUser(text) and UserMessageComponent are the existing user-message render path.
  • dist/tui-*.js: the gateway event dispatch currently handles chat, chat.side_result, and agent.
  • dist/server.impl-*.js: EVENT_SCOPE_GUARDS drops unlisted events, so a new event must be explicitly scoped for operator read clients.
  • dist/claude-live-session-*.js: an external wake/socket injection point can write a stream-json user input to the active Claude live-session stdin.

Proposed API Surface

Add a first-class event for accepted external user-turn injections:

  1. Emit an in-process event from the injection point only after stdin write succeeds and the wake/inbox record is marked consumed.
  2. Broadcast that event over the existing gateway WebSocket channel as wake.injected.
  3. Add wake.injected to EVENT_SCOPE_GUARDS with operator read scope.
  4. Let TUI subscribe through its existing client.onEvent dispatch, filter to the active session, dedupe by wake id or session/timestamp/text hash, and call the existing ChatLog.addUser(text, opts) path.
  5. Render synthetic user turns with a small source badge such as [via wake-socket], while preserving identical rendering for normal operator-typed messages.

Suggested payload shape:

{
  "schema": "openclaw.wake.injected.v1",
  "source": "titus-wake-socket",
  "wake_id": "string-or-null",
  "sessionKey": "agent:titus:main",
  "sessionId": "claude-session-id-or-null",
  "text": "operator-visible wake message",
  "wake_file_path": "/path/to/wake.json",
  "consumed_at": "ISO-8601 timestamp",
  "consumed_by_run_id": "openclaw-gateway:<pid>:<session>",
  "injected_bytes": 1234
}

Local Interim Patch

We are running a local content-anchored dist patch in the interim. It adds:

  • a non-blocking wake event subscriber sink in claude-live-session-*.js
  • a wake.injected scope guard and WebSocket bridge in server.impl-*.js
  • a TUI subscriber that renders synthetic wake user turns with active-session filtering and one-hour dedupe
  • a reapply hook so the local dist patch can be restored after managed OpenClaw updates

Related Issues

  • #83782
  • #83783
  • #83809

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 TUI does not render externally-injected user turns (e.g. via a wake-socket transport) even though they land in the conversation transcript [1 comments, 2 participants]