openclaw - ✅(Solved) Fix /new and /reset commands should clear session-level model override to respect agents.defaults.model configuration [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#67573Fetched 2026-04-17 08:30:09
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
1
Author
Participants
Timeline (top)
cross-referenced ×1referenced ×1

Root Cause

This behavior is unexpected because:

  1. /new and /reset are documented as "start fresh" commands
  2. Gateway restarts do not clear this override
  3. The only way to restore the default model is to manually run /status default (or session_status model=default)

Fix Action

Fix / Workaround

Current Workaround

PR fix notes

PR #67591: fix(session): clear auto-fallback model overrides on /new and /reset

Description (problem / solution / changelog)

Summary

Aligns the reply pipeline's /new and /reset handling with the gateway's sessions.reset service by applying source-aware model override preservation during session resets.

Problem

When the reply pipeline handles /new or /reset chat commands, it unconditionally carries over modelOverride and providerOverride from the previous session. This means auto-fallback model overrides (set by the system during rate-limit or error recovery) persist across explicit "start fresh" commands, preventing the session from falling back to the configured agents.defaults.model.

The gateway's sessions.reset RPC already handles this correctly via resolveResetPreservedSelection(), but the reply pipeline had no equivalent logic.

Fixes #67573

Changes

src/auto-reply/reply/session.ts — single file, 22 insertions / 5 deletions:

  1. Source-aware model override preservation: During /new or /reset, only user-explicit overrides (modelOverrideSource === "user") are carried over. Auto-fallback overrides (modelOverrideSource === "auto") are now cleared.

  2. Legacy backward compatibility: Older sessions without a modelOverrideSource field but with a modelOverride present are treated as user-explicit (same as the gateway's logic).

  3. Auth profile override parity: Same source-aware filtering applied to authProfileOverride — only user-set overrides survive resets.

  4. modelOverrideSource pipeline: Added persistedModelOverrideSource to the session state pipeline so the source field is properly read, carried, and persisted through session entry construction. Backfills "user" for preserved overrides.

Behavior

Override sourceBefore this PRAfter this PR
User (/model gpt-5.4)Preserved ✅Preserved ✅
Legacy (no source field)Preserved ✅Preserved ✅
Auto-fallback (rate limit)Preserved ❌Cleared ✅
No overrideN/AN/A

Testing

The logic mirrors resolveResetPreservedSelection() in src/gateway/session-reset-service.ts, which has existing test coverage in server.sessions.gateway-server-sessions-a.test.ts for all three scenarios (user override preserved, auto-fallback cleared, legacy backfilled).

Changed files

  • src/auto-reply/reply/session.ts (modified, +22/-5)
RAW_BUFFERClick to expand / collapse

Problem Description

When a user explicitly changes the model via /model <model-id>, the session-level model override persists even after running /new or /reset. This causes the session to continue using the previously selected model instead of falling back to the configured default (agents.defaults.model.primary).

This behavior is unexpected because:

  1. /new and /reset are documented as "start fresh" commands
  2. Gateway restarts do not clear this override
  3. The only way to restore the default model is to manually run /status default (or session_status model=default)

Steps to Reproduce

  1. Configure agents.defaults.model.primary to anthropic_kimi/k2.6-code-preview
  2. Start a conversation, verify model is anthropic_kimi/k2.6-code-preview
  3. Run /model openai-codex/gpt-5.4 to switch model
  4. Run /new or /reset to "start fresh"
  5. Check /status — model is still openai-codex/gpt-5.4 (unexpected)
  6. Expected: model should reset to anthropic_kimi/k2.6-code-preview

Current Workaround

After /new, manually run /status default to clear the model override.

Proposed Solutions

Option A (Preferred): /new and /reset should automatically clear session-level model overrides, respecting the agents.defaults.model configuration.

Option B: Add a configuration option like session.resetClearsModelOverride: true to enable this behavior explicitly.

Environment

  • OpenClaw version: 2026.4.12
  • Config: agents.defaults.model.primary = "anthropic_kimi/k2.6-code-preview"

Signatures

extent analysis

TL;DR

The most likely fix is to modify the /new and /reset commands to automatically clear session-level model overrides, respecting the agents.defaults.model configuration.

Guidance

  • Review the implementation of /new and /reset commands to ensure they reset the session state, including model overrides, to their default values.
  • Verify that the agents.defaults.model.primary configuration is correctly set to anthropic_kimi/k2.6-code-preview and that this value is used as the default model when no override is present.
  • Consider adding a configuration option like session.resetClearsModelOverride: true to enable the desired behavior explicitly, as proposed in Option B.
  • Test the fix by following the steps to reproduce and verifying that the model resets to the default after running /new or /reset.

Example

No code snippet is provided as the issue does not include specific implementation details.

Notes

The fix may require changes to the OpenClaw codebase, specifically the implementation of the /new and /reset commands. The proposed solutions, Option A and Option B, provide a clear direction for the fix.

Recommendation

Apply workaround: Modify the /new and /reset commands to automatically clear session-level model overrides, as this is the preferred solution (Option A) and aligns with the expected behavior of "start fresh" 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…

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 - ✅(Solved) Fix /new and /reset commands should clear session-level model override to respect agents.defaults.model configuration [1 pull requests, 1 participants]