openclaw - 💡(How to fix) Fix `openclaw agent` defaults --channel to last, silently resumes most recent session [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#71417Fetched 2026-04-26 05:13:01
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

openclaw agent --agent <id> -m "..." invoked without --session-id defaults --channel to last, which silently resumes whatever session was most recently active. There's no warning, no banner, and no easy way for an operator running a fresh test to discover this without reading the resulting agentMeta.sessionId and noticing it's old.

Root Cause

Combined with [related issue on --session-id being silently remapped], operators have no obvious knob to force fresh sessions for testing. We resorted to moving agents/<id>/sessions/ aside between runs.

RAW_BUFFERClick to expand / collapse

Summary

openclaw agent --agent <id> -m "..." invoked without --session-id defaults --channel to last, which silently resumes whatever session was most recently active. There's no warning, no banner, and no easy way for an operator running a fresh test to discover this without reading the resulting agentMeta.sessionId and noticing it's old.

Reproduction

  1. Run any openclaw agent --agent foo -m "first message".
  2. Wait an arbitrary amount of time (could be days).
  3. Run openclaw agent --agent foo -m "second message" (no --session-id, no --channel).
  4. Inspect the run report's agentMeta.sessionId and usage.input_tokens.

Observed behaviour

The second run is appended to the first session. input_tokens includes the entire prior conversation. The agent may produce confusing replies if the original context was unrelated (for us: a stale 17k-token investigation got "ping" appended and the model tried to continue the investigation).

Expected behaviour

One of:

  • Default --channel to new (always start a fresh session), or
  • Add a --new-session / --fresh flag and document that not passing it keeps the previous session, or
  • Print a one-line banner: Resuming session <id> from <timestamp>; pass --new-session for a fresh run.

Why this matters

Combined with [related issue on --session-id being silently remapped], operators have no obvious knob to force fresh sessions for testing. We resorted to moving agents/<id>/sessions/ aside between runs.

Environment

OpenClaw 2026.4.12 (1c0672b).

extent analysis

TL;DR

To avoid silently resuming a previous session, consider adding a --new-session flag or modifying the default behavior of --channel to start a fresh session.

Guidance

  • Verify the current behavior by inspecting the agentMeta.sessionId and usage.input_tokens in the run report after running openclaw agent --agent foo -m "second message" without --session-id or --channel.
  • To mitigate the issue, manually move the agents/<id>/sessions/ directory aside between runs to force a fresh session.
  • Consider modifying the openclaw agent command to include a warning or banner when resuming a previous session, such as Resuming session <id> from <timestamp>; pass --new-session for a fresh run.
  • Review the related issue on --session-id being silently remapped to understand the full scope of the problem.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

The issue is specific to OpenClaw version 2026.4.12 (1c0672b), and the suggested solutions may not apply to other versions.

Recommendation

Apply a workaround, such as manually moving the agents/<id>/sessions/ directory aside between runs, until a permanent fix is implemented. This is because the current behavior can lead to confusing replies from the agent and makes it difficult for operators to force fresh sessions for testing.

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 `openclaw agent` defaults --channel to last, silently resumes most recent session [1 participants]