Skip to content

[Bug]: openclaw sessions list returns exit code 0 despite error output #60905

@tz-wang1015

Description

@tz-wang1015

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Bug Description

When running openclaw sessions list with any argument (e.g., openclaw sessions list 2>&1), the CLI reports an error:

error: too many arguments for 'sessions'. Expected 0 arguments but got 1.

Steps to reproduce

However, the command exits with code 0 (success), making it impossible for scripts or monitoring tools to distinguish between a successful run and a failure.

Expected Behavior

  • Command failure should return a non-zero exit code
  • Exit code 0 should only be returned on success

Environment

  • OpenClaw version: 2026.4.2 (commit d74a122)
  • Node.js: v24.14.0
  • Platform: Windows_NT 10.0.26200 (x64)
  • Shell: PowerShell

Reproduction Steps

openclaw sessions list 2>&1
# Expected: non-zero exit code
# Actual: exit code 0

### Expected behavior

The error message indicates the sessions subcommand does not accept arguments, but the CLI incorrectly returns success despite the error message being printed to stderr.

### Actual behavior

error found at 2026/4/4 22:40 CST

### OpenClaw version

2026.4.2

### Operating system

Windows 11

### Install method

_No response_

### Model

minimax2.7

### Provider / routing chain

minimax

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence

```shell

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions