Skip to content

[Bug]: CLI rejects --duration-min 0 for clearing Discord timeouts #93327

Description

@rohitjavvadi

Summary

The Discord timeout CLI rejects --duration-min 0 before dispatch, even though the Discord moderation runtime treats zero minutes as the supported way to clear an existing timeout.

Steps to reproduce

  1. Use current main at c1219d161d.
  2. Run the message timeout CLI path with --duration-min 0, for example:
openclaw message timeout --guild-id G1 --user-id U1 --duration-min 0

Expected behavior

The CLI should accept 0 and pass it to the Discord timeout action so the lower Discord path can clear the timeout by sending communication_disabled_until: null.

Actual behavior

The shared message CLI validator treats durationMin as strictly positive and fails early with --duration-min must be a positive integer.

Evidence

  • src/cli/program/message/helpers.ts currently validates durationMin with the positive-integer option bucket.
  • extensions/discord/src/actions/handle-action.guild-admin.ts reads durationMin with readNonNegativeIntegerParam.
  • extensions/discord/src/actions/runtime.test.ts already covers preserving durationMinutes: 0 for clearing existing timeouts.
  • extensions/discord/src/send.guild.ts maps zero/absent duration to communication_disabled_until: null.

Impact

Users cannot clear a Discord timeout through the CLI using the explicit zero-duration form, even though the runtime and agent-tool schema already allow it.

Environment

  • OpenClaw version: current main at c1219d161d
  • OS: macOS local checkout
  • Install method: pnpm dev/local checkout
  • Model/provider: N/A
  • Provider/routing chain: N/A

Validation target

A fix should allow --duration-min 0 through the CLI boundary while keeping malformed values such as 5m, empty strings, and fractional values rejected before dispatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions