openclaw - ✅(Solved) Fix [Bug]: Webchat functionality seems broken [1 pull requests, 1 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#59651Fetched 2026-04-08 02:42:08
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1labeled ×1referenced ×1

It seems like the agent is interpreting it's workspace files as my commands (which is totally wrong) and this is visible in the webchat.

If I type "/new" to start a new session this gets printed to the chat:

"A new session was started via /new or /reset. Run your Session Startup sequence - read the required files before responding to the user. Then greet the user in your configured persona, if one is provided. Be yourself - use your defined voice, mannerisms, and mood. Keep it to 1-3 sentences and ask what they want to do. If the runtime model differs from default_model in the system prompt, mention the default model. Do not mention internal steps, files, tools, or reasoning."

And it looks like I've written this message:

<img width="1538" height="250" alt="Image" src="https://github.com/user-attachments/assets/6539697e-bdf4-4998-8c44-73067fa4ff0e" />

Root Cause

It seems like the agent is interpreting it's workspace files as my commands (which is totally wrong) and this is visible in the webchat.

If I type "/new" to start a new session this gets printed to the chat:

"A new session was started via /new or /reset. Run your Session Startup sequence - read the required files before responding to the user. Then greet the user in your configured persona, if one is provided. Be yourself - use your defined voice, mannerisms, and mood. Keep it to 1-3 sentences and ask what they want to do. If the runtime model differs from default_model in the system prompt, mention the default model. Do not mention internal steps, files, tools, or reasoning."

And it looks like I've written this message:

<img width="1538" height="250" alt="Image" src="https://github.com/user-attachments/assets/6539697e-bdf4-4998-8c44-73067fa4ff0e" />

Fix Action

Fixed

PR fix notes

PR #59684: fix(gateway): suppress /new startup chatter in chat history

Description (problem / solution / changelog)

Summary

  • Fixes a WebChat history leak where /new//reset startup control content could appear as user-visible chat messages.
  • Suppresses startup-sequence chatter in chat.history, including reset control turns and bootstrap read toolCall/toolResult noise.
  • Keeps real assistant replies visible while preserving existing NO_REPLY filtering behavior.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Fixes #59651
  • Related #59651

User-visible / Behavior Changes

  • WebChat no longer shows internal /new or /reset startup instructions and bootstrap read chatter in chat history.
  • Normal assistant replies still appear after reset/new startup.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: Ubuntu 24.04
  • Runtime/container: local gateway + WebChat
  • Model/provider: openrouter/free (issue report), plus local regression fixtures
  • Integration/channel (if any): WebChat (chat.history)
  • Relevant config (redacted): default session setup

Steps

  1. Trigger a fresh /new or /reset session startup.
  2. Let startup sequence run bootstrap file reads.
  3. Call chat.history for that session.

Expected

  • Internal startup control prompt and bootstrap read tool chatter are hidden.
  • Final assistant greeting/reply remains visible.

Actual

  • Before fix: startup control content leaked into chat.history.
  • After fix: startup control content is suppressed.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios:
    • chat.history suppresses startup chatter after /new and /reset-equivalent startup content.
    • chat.history still keeps regular assistant messages.
    • Existing NO_REPLY filtering tests remain green.
  • Edge cases checked:
    • Bare /new command history entries.
    • Startup toolCall + toolResult sequences for bootstrap file reads.
  • What you did not verify:
    • Full end-to-end browser UI manual run in this PR branch.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly:
    • Revert this single commit on the fix branch.
  • Files/config to restore:
    • src/gateway/server-methods/chat.ts
    • src/gateway/server.chat.gateway-server-chat.test.ts
  • Known bad symptoms reviewers should watch for:
    • chat.history unexpectedly dropping valid non-startup user/assistant messages.

Risks and Mitigations

  • Risk:
    • Over-filtering non-startup transcript entries if they mimic startup patterns.
    • Mitigation:
      • Combined command + sequence-aware filtering and targeted gateway history regression tests.

Changed files

  • src/gateway/server-methods/chat.ts (modified, +157/-0)
  • src/gateway/server.chat.gateway-server-chat.test.ts (modified, +135/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

It seems like the agent is interpreting it's workspace files as my commands (which is totally wrong) and this is visible in the webchat.

If I type "/new" to start a new session this gets printed to the chat:

"A new session was started via /new or /reset. Run your Session Startup sequence - read the required files before responding to the user. Then greet the user in your configured persona, if one is provided. Be yourself - use your defined voice, mannerisms, and mood. Keep it to 1-3 sentences and ask what they want to do. If the runtime model differs from default_model in the system prompt, mention the default model. Do not mention internal steps, files, tools, or reasoning."

And it looks like I've written this message:

<img width="1538" height="250" alt="Image" src="https://github.com/user-attachments/assets/6539697e-bdf4-4998-8c44-73067fa4ff0e" />

Steps to reproduce

  1. Fresh install of openclaw
  2. Try to interact with the chat

Expected behavior

Chat should work as intended.

Actual behavior

Chat is messed up like I've described in the summary.

OpenClaw version

OpenClaw 2026.4.1 (da64a97)

Operating system

Ubuntu 24.04

Install method

npm

Model

openrouter/free

Provider / routing chain

openclaw -> openrouter

Additional provider/model setup details

I don't think this issue is related to model interaction.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

I've noticed in the workspace dir that BOOTSTRAP.md was never deleted, which I understand should be done.

It's also strange that my main agent was renamed to "heartbeat" for some strange reason and the heartbeats are printed to the main chat:

<img width="1845" height="958" alt="Image" src="https://github.com/user-attachments/assets/acad7b47-548a-4e70-8232-ddb3e2fdd016" />

extent analysis

TL;DR

The issue can be resolved by properly cleaning up the workspace files, specifically deleting the BOOTSTRAP.md file, and ensuring the agent configuration is correct.

Guidance

  • Verify that the workspace directory is properly cleaned up after installation, and delete any unnecessary files such as BOOTSTRAP.md.
  • Check the agent configuration to ensure that it is not interpreting workspace files as commands.
  • Review the installation process to ensure that the agent is properly set up and configured.
  • Investigate why the main agent was renamed to "heartbeat" and heartbeats are being printed to the main chat, as this may be related to the issue.

Example

No code snippet is provided as the issue does not require a specific code change.

Notes

The issue may be related to a misconfiguration or incorrect cleanup of the workspace directory. Further investigation is needed to determine the root cause of the issue.

Recommendation

Apply workaround: properly clean up the workspace files and verify the agent configuration to resolve the issue. This is recommended as it is a straightforward step that can potentially resolve the issue without requiring further changes.

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…

FAQ

Expected behavior

Chat should work as intended.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING