Skip to content

[Bug]: exec tool action parameter should default to "run" instead of being required #3268

Description

@MrTreasure

Problem

The exec tool currently marks action as a required parameter with no default value. This causes failures in two scenarios:

1. AI agent calls fail unpredictably

When an LLM calls the exec tool but omits action: "run" (which is the overwhelmingly common case - you almost always want to execute a command), the call fails with action is required. This is a fragile API that punishes the default use case.

2. Internal callers need manual workarounds

Internal code paths that call the exec tool (e.g., cron job execution in #2938) must explicitly pass action: "run", making the code more verbose and error-prone. Every missed action parameter is a silent failure.

Root Cause

PR #2938 fixed the symptom (cron not passing action: "run") by patching the caller, but did not address the underlying API design issue: the exec tool requires an explicit action without providing a sensible default.

Suggestion

Set the default value of action to "run". This is:

  • Backward-compatible: existing code that explicitly passes action: "run" continues to work
  • Future-safe: new callers default to the most common operation
  • Consistent with how users actually use this tool

For the rare cases where a different action (like list, poll, read, write, kill) is needed, the caller can still pass it explicitly.

Related

Environment

  • picoclaw version: 0.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions