openclaw - ✅(Solved) Fix Bug: bare /reset falls through to model call with empty input [2 pull requests, 4 comments, 4 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#73367Fetched 2026-04-29 06:20:31
View on GitHub
Comments
4
Participants
4
Timeline
10
Reactions
0
Author
Timeline (top)
commented ×4cross-referenced ×4closed ×1referenced ×1

Sending a bare /reset command in a Discord channel resets/rolls the session but then attempts normal model execution with an empty input, producing a provider error instead of a reset acknowledgement.

Error Message

Sending a bare /reset command in a Discord channel resets/rolls the session but then attempts normal model execution with an empty input, producing a provider error instead of a reset acknowledgement. 3. Observe the user-visible provider error instead of a reset acknowledgement. The command returns a provider error: The visible error is from the OpenAI Responses-compatible API validation rejecting an empty request. The reset-flow issue appears provider-independent because the command handler can fall through with no input after a bare /reset. User-visible error after sending /reset: Severity: Annoying behavior bug; reset appears to fail and shows a provider-level error. Consequence: Users see an unrelated model/provider error instead of confirmation that reset completed.

Root Cause

The visible error is from the OpenAI Responses-compatible API validation rejecting an empty request. The reset-flow issue appears provider-independent because the command handler can fall through with no input after a bare /reset.

Fix Action

Fix / Workaround

A local hotfix that stops the fallthrough for empty reset tails resolved the issue:

PR fix notes

PR #73371: fix(commands): stop bare /reset and /new from falling through to empty model call

Description (problem / solution / changelog)

Summary

  • Problem: a bare /reset (or /new) sent to a non-ACP session resets the session, then the command handler returns null, letting normal command processing continue with an empty body. With the OpenAI Responses API the resulting model call is rejected with One of "input" or "previous_response_id" or "prompt" or "conversation_id" must be provided instead of a reset acknowledgement.
  • Why it matters: every bare /reset against an OpenAI Responses-backed agent surfaces a provider error to the user instead of a clean acknowledgement.
  • What changed: in src/auto-reply/reply/commands-reset.ts, the non-ACP branch now mirrors the ACP branch — when resetTail is empty, return { shouldContinue: false, reply: { text: "✅ Session reset." | "✅ New session started." } } after the reset hooks fire. When a tail is present (e.g. /new take notes), we still return null so the existing tail-dispatch behaviour is unchanged.
  • What did NOT change (scope boundary): no changes to ACP path, soft-reset path, hook payloads, authorization checks, session-clearing logic, or session-store side effects. No new env vars/config keys.

Change Type

  • Bug fix

Scope

  • Gateway (auto-reply command handling)

Linked Issue/PR

  • Closes #73367
  • This PR fixes a bug or regression

Root Cause

  • Root cause: maybeHandleResetCommand in src/auto-reply/reply/commands-reset.ts ended its non-ACP branch with await emitResetCommandHooks(...); return null;. The reset hooks normalize the body, so when the user sent only /reset the subsequent command-pipeline stages saw an empty body and forwarded it to the model.
  • Missing detection: there was no guard for "reset hook ran AND tail is empty" in the non-ACP branch, even though the ACP branch already handled the same case (resetTail empty → reply with ✅ ACP session reset in place.).
  • Contributing context: the OpenAI Responses API surfaces the empty-input case as a hard error, making the latent bug user-visible on Responses-backed providers.

Regression Test Plan

  • Coverage level that should have caught this:
    • Unit test
  • Target test or file: src/auto-reply/reply/commands-reset-hooks.test.ts
  • Scenarios the test locks in:
    • /reset → returns { shouldContinue: false, reply: { text: "✅ Session reset." } } and still emits the reset hook.
    • /new → returns { shouldContinue: false, reply: { text: "✅ New session started." } } and still emits the new hook.
    • /new take notes → continues to return null so the tail can dispatch to the model.
  • Why this is the smallest reliable guardrail: the bug is a single missing branch in maybeHandleResetCommand. The new tests pin both the empty-tail acknowledgement and the non-regression for the tail-dispatch path; the rest of the reset machinery is already covered by adjacent tests in the same file.

User-visible / Behavior Changes

  • Bare /reset now replies with ✅ Session reset. instead of producing a provider error or empty turn.
  • Bare /new now replies with ✅ New session started.
  • /reset <tail> and /new <tail> are unchanged — the tail still dispatches to the model.

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No (this PR removes an empty/erroneous provider call)
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OpenAI Responses-backed agent (any provider that hits One of "input" / "previous_response_id" / "prompt" / "conversation_id" must be provided)

Steps

  1. Configure an agent on the OpenAI Responses API.
  2. Send a bare /reset to that agent on a non-ACP channel (e.g. WhatsApp/Telegram/webchat).

Expected

  • Reset hook fires, then a clean acknowledgement reply is delivered. No provider call.

Actual (before fix)

  • Reset hook fires; command pipeline continues with empty body; provider rejects the request and the error surfaces to the user.

Evidence

  • Static reproduction is provided by the new unit tests in src/auto-reply/reply/commands-reset-hooks.test.ts. The fix mirrors the existing ACP-path behaviour at the top of maybeHandleResetCommand.

Human Verification

  • Verified scenarios: TypeScript clean on touched files; new tests added next to existing reset-hooks suite.
  • Edge cases checked: bare /reset, bare /new, /new <tail> (must still fall through), ACP path (untouched), soft-reset path (untouched).
  • What I did NOT verify: a live end-to-end run against a Responses-backed provider; full pnpm check / pnpm test was not exercised locally, leaving CI as the verification surface.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Risks and Mitigations

  • Risk: a downstream consumer relied on null being returned for bare /reset to trigger some additional pipeline step.
    • Mitigation: this matches the established ACP-path behaviour for the same input; bare /reset was already broken on the OpenAI Responses path, so the previous behaviour was not a load-bearing contract.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/auto-reply/reply/commands-reset-hooks.test.ts (modified, +48/-0)
  • src/auto-reply/reply/commands-reset.ts (modified, +16/-0)

PR #73377: fix(reply): short-circuit bare /reset and /new instead of calling provider with empty input

Description (problem / solution / changelog)

What

When a user sends a bare /reset or /new (no trailing text) on a non-ACP-bound channel, maybeHandleResetCommand emits the reset hooks and returns null, which lets the rest of the auto-reply pipeline continue and call the model provider with an empty body. The OpenAI Responses‑compatible API surfaces this as:

One of "input" or "previous_response_id" or "prompt" or "conversation_id" must be provided.

…instead of the user getting a reset acknowledgement.

Fix

After running the reset hooks, if resetTail is empty, stop the pipeline and reply with a plain ack:

  • /reset✅ Session reset.
  • /new✅ New session started.

/reset <message> and /new <message> are unchanged — they still fall through and seed the next turn with the tail, matching the existing intent.

This mirrors the existing behaviour on the ACP-bound branch above (which already returns an explicit ack when resetTail is empty).

Diff

src/auto-reply/reply/commands-reset.ts — 8 lines added at the bottom of maybeHandleResetCommand, no other changes.

Fixes #73367

Changed files

  • src/auto-reply/reply/commands-reset.ts (modified, +8/-0)

Code Example

One of "input" or "previous_response_id" or "prompt" or "conversation_id" must be provided.

---

User-visible error after sending /reset:
One of "input" or "previous_response_id" or "prompt" or "conversation_id" must be provided.

Verified version:
OpenClaw 2026.4.26 (be8c246)

---

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

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Sending a bare /reset command in a Discord channel resets/rolls the session but then attempts normal model execution with an empty input, producing a provider error instead of a reset acknowledgement.

Steps to reproduce

  1. Run OpenClaw 2026.4.26.
  2. In a Discord channel handled by OpenClaw, send exactly /reset with no additional text.
  3. Observe the user-visible provider error instead of a reset acknowledgement.

Expected behavior

A bare /reset should stop after resetting the session and return an acknowledgement such as ✅ Session reset. It should not call the model/provider when there is no reset tail or user input.

Actual behavior

The command returns a provider error:

One of "input" or "previous_response_id" or "prompt" or "conversation_id" must be provided.

Local code inspection showed /reset is detected as a reset trigger and clears the body, but the non-ACP reset command path continues after emitResetCommandHooks(...), allowing normal reply generation to call the provider with empty input.

OpenClaw version

OpenClaw 2026.4.26 (be8c246)

Operating system

Linux 6.17.0-20-generic x64

Install method

npm global install, running as a native systemd service on SER9

Model

openai-codex/gpt-5.5

Provider / routing chain

OpenClaw gateway -> OpenAI Codex / OpenAI Responses-compatible route

Additional provider/model setup details

The visible error is from the OpenAI Responses-compatible API validation rejecting an empty request. The reset-flow issue appears provider-independent because the command handler can fall through with no input after a bare /reset.

Logs, screenshots, and evidence

User-visible error after sending /reset:
One of "input" or "previous_response_id" or "prompt" or "conversation_id" must be provided.

Verified version:
OpenClaw 2026.4.26 (be8c246)

A local hotfix that stops the fallthrough for empty reset tails resolved the issue:

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

Impact and severity

Affected: Discord channel users sending bare /reset. Severity: Annoying behavior bug; reset appears to fail and shows a provider-level error. Frequency: Observed on a bare /reset attempt. Consequence: Users see an unrelated model/provider error instead of confirmation that reset completed.

Additional information

If /reset has a tail, continuing into a new-session model call may still be intended. The suggested fix is only to stop command processing when the reset tail is empty, while preserving current behavior for /reset <first message>.

extent analysis

TL;DR

The issue can be fixed by adding a conditional return statement to stop command processing when the reset tail is empty.

Guidance

  • Verify that the resetTail variable is correctly set to null or an empty string when a bare /reset command is sent.
  • Add a conditional statement to check if resetTail is empty, and if so, return a response indicating that the session has been reset, without calling the provider.
  • Ensure that the fix does not affect the behavior of /reset commands with a tail, which should continue to trigger a new session.
  • Test the fix with different scenarios, including bare /reset commands and /reset commands with a tail.

Example

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

Notes

The provided local hotfix suggests that the issue is specific to the command handler's behavior when encountering an empty resetTail. The fix should be applied to the relevant code path to prevent the provider error.

Recommendation

Apply the workaround by adding the conditional return statement to stop command processing when the reset tail is empty, as this will prevent the provider error and ensure the correct behavior for bare /reset commands.

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

A bare /reset should stop after resetting the session and return an acknowledgement such as ✅ Session reset. It should not call the model/provider when there is no reset tail or user input.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING