Skip to content

WebChat replay drops user-visible sessions_yield messages stored only as tool results #87321

Closed

Description

@inasens

Summary

On WebChat, a user-visible status update emitted through sessions_yield can appear live, but disappear after refresh/replay because the yielded text is persisted only inside a tool result payload rather than as durable assistant text.

Environment

  • OpenClaw version: 2026.5.26
  • Surface: WebChat
  • Runtime: OpenAI Codex session with OpenClaw session tools

Minimal Repro

  1. In a WebChat session, spawn a child/subagent with sessions_spawn.
  2. Have the parent/session use sessions_yield with a user-visible status message while waiting for push-based child completion.
  3. Observe that the status message appears live in WebChat.
  4. Refresh/reopen/replay the session history.
  5. The yielded status message is no longer visible as a normal assistant message.

Observed

The persisted transcript stores the yielded message as a tool result shape similar to:

{
  "role": "toolResult",
  "toolName": "sessions_yield",
  "content": [{
    "content": "{ \"status\": \"yielded\", \"message\": \"...\" }"
  }]
}

On replay, WebChat appears to render durable assistant messages but not this sessions_yield tool-result payload as visible assistant text. The live optimistic/streamed message is therefore replaced by the persisted snapshot and appears to disappear.

Expected

User-visible text passed to sessions_yield should be durable across transcript replay. Either:

  • sessions_yield should persist a normal assistant-visible message, or
  • WebChat replay should render persisted sessions_yield message payloads as visible assistant status text.

Impact

This looks like message loss to the user and is especially confusing during default subagent workflows, where OpenClaw instructs agents to rely on push completion/yield instead of polling.

Related

Possibly related to #47975, but this issue is narrower: the yielded message is visible live, then disappears on persisted WebChat replay.

Activity

  1. clawsweeper commented on May 27, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed September 6, 2026, 2:28 AM ET / 06:28 UTC.

    Summary
    Keep open: legacy tool-result-only status text still lacks assistant replay projection, and the linked open PR owns that work. Newly merged privacy hardening explicitly excludes private yield context from public output, so recovery cannot safely treat every stored message as public.

    Reproducibility: yes. for legacy replay: a message-only sessions_yield tool result receives no assistant mirror and is hidden when tool display is disabled. The original live sequence was not executed, and current producers now use a separate public acknowledgment.

    Root-cause cluster
    Relationship: canonical
    Canonical: #87321
    Summary: This issue owns the legacy replay problem; an open fix candidate remains, while merged acknowledgment and privacy work address overlapping contracts.

    Members:

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

    Maintainer decision needed

    Question Recommendation
    Should legacy sessions_yield message-only records remain hidden when no durable evidence distinguishes public waiting text from private continuation context? Preserve privacy for ambiguous records: Keep unclassified legacy message fields hidden and narrow the linked PR to public acknowledgment replay or independently established public text.

    Why: The historical report seeks recovery of visible text, but the current explicit privacy contract forbids treating the same field as generally public.

    Next step
    Review or narrow #87471 against the current privacy contract before landing or closing it; do not create a competing repair PR.

    Security
    Needs attention: Legacy recovery needs a public/private distinction before hidden yield context can be displayed.

    Review details

    Best possible solution:

    Keep public acknowledgments durable through the normal reply path and recover legacy waiting text only when its public visibility can be established without exposing private continuation context.

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

    Yes, for legacy replay: a message-only sessions_yield tool result receives no assistant mirror and is hidden when tool display is disabled. The original live sequence was not executed, and current producers now use a separate public acknowledgment.

    Is this the best way to solve the issue?

    No, unrestricted message mirroring is incompatible with the current private-context contract; recovery must distinguish public waiting text from private continuation records.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • A successful legacy yield result does not establish that its message was intended for public display; projecting hidden continuation text could expose private context.
    • The original live-then-refresh sequence was not executed, and the reported release’s source blob could not be inspected; current-source evidence establishes the legacy replay mechanism, not a fresh occurrence on the latest release.

    Codex review notes: model internal, reasoning medium; reviewed against 397ec2e8c968.

    Label changes

    Label changes:

    • add clawsweeper:needs-security-review: Current issue advisory state selects this label.
    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.
    • remove clawsweeper:needs-maintainer-review: Current issue advisory state no longer selects this label.

    Label justifications:

    • P2: The remaining problem concerns bounded legacy WebChat replay, with an existing implementation candidate and no demonstrated current core outage.
    • impact:message-loss: Previously visible waiting text disappears from the displayed conversation after replay.
    • impact:session-state: Live conversation output and persisted session replay disagree about which status text is visible.
    Evidence reviewed

    Security concerns:

    • [medium] Do not infer public visibility from a yielded result — src/agents/sessions-yield-context.ts:6
      The linked candidate proposes displaying message fields from hidden continuation and legacy result records, while current source defines message as private; the issue’s repair must preserve that boundary.
      Confidence: 0.98

    What I checked:

    • Current source identity: Checkout is 6526116. The yield tool and Gateway projector have identical blob identities at fetched main 397ec2e; separate tree checks also matched the hidden-context helper, history filter, privacy sanitizer, and browser message-group renderer. (src/gateway/chat-display-projection.core.ts:396, 397ec2e8c968)
    • Legacy replay remains distinct: The display pipeline invokes message-tool mirroring, then sanitization and visibility filtering; it does not project sessions_yield message payloads into assistant replies. Hidden continuation records are excluded by the display=false filter. (src/gateway/chat-display-projection.core.ts:396, 652611689023)
    • Browser hides tool groups: The browser returns no rendered content for tool message groups when showToolCalls is false, explaining why an unmirrored legacy tool result is not a normal visible assistant reply. (ui/src/pages/chat/components/chat-message-group.ts:372, 652611689023)
    • Explicit public/private contract: The tool defines message as private resumed-turn context and acknowledgment as the optional public waiting reply. Successful results now contain status and optional acknowledgment, without message. The documentation makes the same distinction. (src/agents/tools/sessions-yield-tool.ts:15, 652611689023)
    • Private continuation storage: The shared continuation builder stores message in a custom openclaw.sessions_yield record with display=false. Its contents cannot be presumed user-visible from the tool name or successful status alone. (src/agents/sessions-yield-context.ts:6, 652611689023)
    • New merged privacy direction: GitHub verifies that the privacy follow-up merged as f04aa55. Its stated outcome removes private yield context from returned tool content and public history while preserving acknowledgment behavior. This strengthens the privacy concern retained from the previous review. (src/agents/tools/sessions-yield-tool.ts:57, f04aa558115b)

    Likely related people:

    • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    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.
  2. WarrenJones commented on May 27, 2026

    @WarrenJones
  3. added
    P2Normal backlog priority with limited blast radius.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    and removed
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jun 15, 2026
  4. added
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    and removed
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    on Jul 29, 2026
  5. 19 remaining items

  6. added
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    and removed
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    on Aug 26, 2026
  7. steipete commented on Oct 24, 2026

    @steipete
    Contributor

    Thanks for filing this. We're closing older issues that no longer look actionable on current main.

    Current sessions_yield producers now emit a separate public acknowledgment that survives replay; only legacy records from older releases keep the status text inside the tool result.

    OpenClaw has changed a lot since this was filed. If this still affects you on the latest release, please open a fresh issue with your version and repro steps (feel free to link back here).

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

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions