openclaw - 💡(How to fix) Fix Bug: /new in WebChat (Control UI) does not trigger startupContext or agent run [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#78430Fetched 2026-05-07 03:36:59
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
2
Timeline (top)
commented ×1

When sending /new or /reset via the WebChat (Control UI), the agent receives no startupContext and no agent turn is started. The only response is a static "✅ New session started." message. This is a regression from v2026.4.21, where startupContext worked correctly after /new.

Root Cause

Two separate code paths exist for handling /new:

Fix Action

Workaround

Users can type a message after /new (e.g., /new hello) which sets resetTail and allows the agent turn to proceed, though the startupContext prelude is still not prepended in this case. Alternatively, users can manually send a trigger message after /new to prompt the agent to execute its startup routine.

Code Example

if (!resetTail) return {
    shouldContinue: false,
    ...hookResult.routedReply ? {} : { reply: { text: commandAction === "reset" ? "✅ Session reset." : "✅ New session started." } }
};
RAW_BUFFERClick to expand / collapse

Bug: /new in WebChat (Control UI) does not trigger startupContext or agent run

Description

When sending /new or /reset via the WebChat (Control UI), the agent receives no startupContext and no agent turn is started. The only response is a static "✅ New session started." message. This is a regression from v2026.4.21, where startupContext worked correctly after /new.

Steps to Reproduce

  1. Open WebChat (Control UI) in browser
  2. Type /new and send
  3. Observe: Response is only "✅ New session started."
  4. Agent never executes its startup sequence (reading SOUL.md, USER.md, MEMORY.md, daily memory, greeting the user)

Expected Behavior

After /new, the agent should:

  1. Receive the startup prompt ("A new session was started via /new or /reset. Execute your Session Startup sequence now...")
  2. Receive the startupContext prelude (daily memory files)
  3. Execute its startup routine (read configured files, greet user in persona)

This works correctly in the agent.send path (CLI/API).

Actual Behavior

The command handler in maybeHandleResetCommand() returns { shouldContinue: false, reply: { text: "✅ New session started." } } for bare /new (no trailing text), which aborts the entire agent reply flow before the isBareSessionReset logic is reached. No agent turn is started, no startupContext is built.

Root Cause Analysis

Two separate code paths exist for handling /new:

Path A: agent.send (CLI/API) — Works correctly

  • server-methods-Dvr1K7zh.js ~line 920
  • /new is matched before agent dispatch
  • runSessionResetFromAgent() performs the session reset
  • bareResetPromptState is built with the startup prompt
  • shouldPrependStartupContext is set correctly
  • Agent run starts with full startupContext ✅

Path B: chat.send (WebChat/Control UI) — Broken

  • chat-ow5U9oSa.js ~line 1565 → get-reply-CQW0ur-n.jshandleInlineActions()maybeHandleResetCommand()
  • maybeHandleResetCommand() (commands.runtime-Bu_VU3by.js, line 131-140) detects bare /new and returns shouldContinue: false with static reply
  • handleInlineActions() exits immediately with the static reply
  • isBareSessionReset logic (line 2160) is never reached
  • No agent turn, no startupContext ❌

Critical code in commands.runtime-Bu_VU3by.js:

if (!resetTail) return {
    shouldContinue: false,
    ...hookResult.routedReply ? {} : { reply: { text: commandAction === "reset" ? "✅ Session reset." : "✅ New session started." } }
};

Additional Issue: No session reset in chat.send path

In the chat.send path, maybeHandleResetCommand() only fires hooks via emitResetCommandHooks(). It does not perform an actual session reset (transcript archival, new session ID). The session remains unchanged.

Environment

  • OpenClaw v2026.5.5 (also present in v2026.5.4)
  • macOS, Node 22.22.2
  • Channel: WebChat (Control UI)
  • startupContext config: enabled: true, applyOn: ["new", "reset"], dailyMemoryDays: 2

Regression

This worked correctly in v2026.4.21. The regression was introduced between v2026.4.21 and v2026.5.4.

Suggested Fix Options

Option 1: In maybeHandleResetCommand(), return null for bare /new//reset instead of shouldContinue: false. This would let the isBareSessionReset logic in get-reply handle the case properly. However, the actual session reset must also be performed.

Option 2: Add proper session reset handling (runSessionResetFromAgent()) to the chat.send path, mirroring the agent.send implementation, then start an agent turn with the startup prompt.

Option 3: Delegate /new//reset in chat.send to the agent.send handler which already handles these commands correctly.

Workaround

Users can type a message after /new (e.g., /new hello) which sets resetTail and allows the agent turn to proceed, though the startupContext prelude is still not prepended in this case. Alternatively, users can manually send a trigger message after /new to prompt the agent to execute its startup routine.

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 Bug: /new in WebChat (Control UI) does not trigger startupContext or agent run [1 comments, 2 participants]