Skip to content

fix: preserve webchat session-event replies via transcript mirror - #31375

Closed
domiclaw wants to merge 1 commit into
openclaw:mainfrom
kyaky:fix/issue-31348
Closed

domiclaw wants to merge 1 commit into
openclaw:mainfrom
kyaky:fix/issue-31348

Conversation

@domiclaw

@domiclaw domiclaw commented Mar 2, 2026

Copy link
Copy Markdown

Summary

Handle internal webchat reply routing in routeReply by mirroring assistant output into the session transcript instead of failing as unsupported.

Problem

Session-event-triggered runs (for example exec-event wakes) can produce assistant output for webchat sessions, but routeReply previously returned:

  • Webchat routing not supported for queued replies

This caused those responses to be dropped from the webchat-visible flow.

Changes

  • In routeReply:
    • for channel === "webchat", require sessionKey
    • mirror reply payload into transcript via appendAssistantMessageToSessionTranscript
    • return success when mirror succeeds
  • Added regression test:
    • mirrors internal webchat replies into session transcript

Notes

This keeps behavior safe for non-routable internal webchat while preserving session-event outputs for webchat sessions.

Fixes #31348

@greptile-apps

greptile-apps Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Changed routeReply to handle webchat channels by mirroring assistant replies into the session transcript instead of returning an error. This preserves session-event-triggered outputs (like exec-event wakes) for webchat sessions.

Key changes:

  • When channel === "webchat", now requires sessionKey and calls appendAssistantMessageToSessionTranscript
  • Returns success when transcript mirroring succeeds, error with details if it fails
  • Added regression test verifying the mirror behavior

Impact:

  • Fixes the issue where assistant outputs from session events were dropped for webchat sessions
  • Maintains safety by requiring sessionKey for webchat routing
  • The mirrored replies will be visible in the webchat session transcript

Confidence Score: 4/5

  • This PR is safe to merge with low risk
  • The change is well-contained and properly handles the webchat routing case. Error handling is appropriate (checks for sessionKey, validates mirroring result). The logic correctly preserves webchat session-event outputs by mirroring to transcript. Minor deduction for test coverage - could benefit from tests for error cases (missing sessionKey, failed mirroring), but the happy path test is clear and the implementation follows existing patterns.
  • No files require special attention

Last reviewed commit: b4d3093

@openclaw-barnacle

Copy link
Copy Markdown

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

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 6, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #pr-thunderdome-dangerzone on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session event runs do not route outbound replies for webchat sessions

1 participant