Skip to content

TUI --session mode doesn't live-stream messages #45388

Closed as not planned
BingqingLyu/openclaw
#640

Description

@bwatchmitch

Bug

When running:

openclaw tui --session "telegram:direct:<id>" --deliver

The TUI loads message history on launch but does not receive real-time updates.

Observed behavior

  • New inbound Telegram messages don't appear in the TUI
  • Agent replies don't echo back into the TUI view
  • The only way to see new messages is to kill and relaunch the TUI

Expected behavior

TUI should live-tail the session — both inbound messages and agent responses should stream in real time.

Environment

  • OpenClaw 2026.3.8
  • macOS Darwin arm64 (Mac mini)
  • Telegram channel (direct chat)

Activity

  1. bwatchmitch commented on Mar 13, 2026

    @bwatchmitch
    Author

    Additional finding: The TUI does update when pressing Ctrl+T (manual refresh), confirming it's polling/fetching history rather than subscribing to live session events via websocket. Real-time streaming is not happening — updates only appear on manual trigger or relaunch.

  2. bwatchmitch commented on Mar 13, 2026

    @bwatchmitch
    Author

    Another finding: Pressing Ctrl+T to refresh the TUI duplicates the last agent response each time it's pressed. The same messages appear correctly (once) in Telegram. Likely the refresh is appending history without deduplicating against what's already rendered.

  3. bwatchmitch commented on Mar 13, 2026

    @bwatchmitch
    Author

    Additional note: --deliver only pushes agent responses to the Telegram channel. User messages typed in the TUI do not appear in Telegram at all. For true bidirectional mirroring, user input from TUI would also need to be relayed to the connected channel. Consider a --mirror or --bidirectional mode.

  4. openclaw-barnacle commented on Apr 29, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. added
    stale
    on Apr 29, 2026
  6. clawsweeper commented on Apr 29, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 5, 2026, 11:27 AM ET / 15:27 UTC.

    Summary
    Keep open: current main still emits session transcript updates without a TUI session.message consumer, and the same live-message gap is already owned by the older canonical issue plus an open candidate PR.

    Reproducibility: yes. at source level: current main broadcasts displayable transcript updates as session.message, but the TUI event dispatcher does not handle that event family. I did not run a live Telegram reproduction in this read-only pass.

    Root-cause cluster
    Relationship: duplicate
    Canonical: #38829
    Summary: This issue is the same root TUI live-message visibility bug as the older canonical report, with open PR work already targeting that path.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Next step
    Do not start a separate fix lane from this issue because #38829 and #96252 already own the same narrow repair path.

    Review details

    Best possible solution:

    Land or close the viable same-root TUI fix, preferably by consuming existing Gateway session.message transcript events without changing channel delivery semantics; keep bidirectional mirroring as separate product work.

    Do we have a high-confidence way to reproduce the issue?

    Yes at source level: current main broadcasts displayable transcript updates as session.message, but the TUI event dispatcher does not handle that event family. I did not run a live Telegram reproduction in this read-only pass.

    Is this the best way to solve the issue?

    Yes at direction level: consuming existing Gateway session.message updates in the TUI is the narrowest maintainable repair for the live-tail gap. The bidirectional mirror idea in the comments should remain separate product work unless maintainers explicitly choose it.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No live Telegram/Desktop reproduction was run in this read-only review; the source path is strong, but real transport proof should come through the linked PR before merge.
    • The open candidate PR still needs maintainer review and real behavior proof before this issue can close as implemented.

    Codex review notes: model internal, reasoning high; reviewed against 14b2ca11ffa9.

    Label changes

    Label justifications:

    • P2: The bug affects real-time TUI visibility but has a bounded TUI/Gateway surface and an open candidate fix path.
    • impact:session-state: The active TUI view can drift from the Gateway session transcript because live transcript events are not rendered.
    • impact:message-loss: Inbound channel messages and some replies remain invisible in the TUI until reload even though they exist in session history.
    Evidence reviewed

    What I checked:

    • Current TUI dispatcher misses transcript events: The current TUI websocket dispatcher handles chat, chat.side_result, agent, and sessions.changed, with no session.message branch for live transcript updates. (src/tui/tui.ts:1541, 14b2ca11ffa9)
    • Current TUI event types do not model session messages: ChatEvent is limited to run states delta, final, aborted, and error; there is no typed TUI session-message event handler in this module. (src/tui/tui-types.ts:30, 14b2ca11ffa9)
    • Gateway now broadcasts displayable transcript updates: Current main projects transcript updates and broadcasts them as session.message to subscribed websocket connection ids. (src/gateway/server-session-events.ts:204, 14b2ca11ffa9)
    • TUI subscribes to session events but does not render this event family: Gateway TUI calls sessions.subscribe, and the gateway includes session-event subscribers in the session.message broadcast set; the remaining gap is the missing TUI event consumer. (src/tui/gateway-chat.ts:199, 14b2ca11ffa9)
    • Protocol docs expose the intended event contract: The Gateway protocol docs list sessions.messages.subscribe and session.message as transcript/message event surfaces, confirming this is a supported live update path. Public docs: docs/gateway/protocol.md. (docs/gateway/protocol.md:439, 14b2ca11ffa9)
    • Latest release is not fixed: Release v2026.6.11 still has no session.message branch in the TUI dispatcher, so the issue is not shipped-fixed. (src/tui/tui.ts:1538, e085fa1a3ffd)

    Likely related people:

    • harjothkhara: Authored the open same-root PR that adds TUI handling for live session.message updates and related regression coverage. (role: candidate fix author; confidence: high; commits: ecc6c0503a8c, 3c804a7c40b5; files: src/tui/tui-event-handlers.ts, src/tui/tui.ts, src/tui/tui-types.ts)
    • Peter Steinberger: Recent current-main TUI work touched the dispatcher area and git blame on the current shallow checkout attributes the active TUI event block to the current grafted history. (role: recent TUI area contributor; confidence: medium; commits: cd305b3b0cb9, 785ab747798; files: src/tui/tui.ts)
    • gumadeiras: Introduced the split Gateway runtime/session-event files that now carry transcript broadcast handling for session.message. (role: gateway event surface contributor; confidence: medium; commits: 8de63ca26825; files: src/gateway/server-session-events.ts, src/gateway/server-runtime-subscriptions.ts)
    • vincentkoc: Authored an earlier direct TUI repair commit that added a session.message handler, though that commit is not contained by current main or release tags. (role: prior repair author; confidence: medium; commits: 9421edb6e689; files: src/tui/tui-event-handlers.ts, src/tui/tui.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  7. removed
    stale
    on Apr 30, 2026
  8. added
    P2
    clawsweeper:source-repro
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    impact:message-loss
    impact:session-state
    issue-rating: 🦞 diamond lobster
    on May 16, 2026
  9. openclaw-barnacle commented on Jun 8, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  10. added
    stale
    on Jun 8, 2026
  11. added
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    and removed
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    on Jun 14, 2026
  12. steipete commented on Jul 7, 2026

    @steipete
    Contributor

    Closing as a duplicate of #38829.

    Both reports describe the same selected-session TUI gap: history loads initially, but live session.message transcript updates from Telegram or another surface are not consumed until the TUI reloads. #38829 is the canonical issue; #96252 is the active fix candidate. The broader opt-in cross-channel observer request remains separate in #40678.

    Thanks for the Telegram-specific reproduction; it is useful validation for the canonical fix.

  13. locked as resolved and limited conversation to collaborators on Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:message-lossimpact:session-stateissue-rating: 🦞 diamond lobsterstale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions