FoundationAgents/OpenManus · warning · ToolError

no command provided.

Error message

no command provided.

What it means

The outer Bash tool's execute() accepts a command string; 'restart' is the reserved word that recycles the session, any other non-None string is run, but command=None (no arguments at all) falls through to this ToolError. It is an API-contract error: the tool was invoked without specifying what to do.

Source

Thrown at app/tool/bash.py:152

    async def execute(
        self, command: str | None = None, restart: bool = False, **kwargs
    ) -> CLIResult:
        if restart:
            if self._session:
                self._session.stop()
            self._session = _BashSession()
            await self._session.start()

            return CLIResult(system="tool has been restarted.")

        if self._session is None:
            self._session = _BashSession()
            await self._session.start()

        if command is not None:
            return await self._session.run(command)

        raise ToolError("no command provided.")


if __name__ == "__main__":
    bash = Bash()
    rst = asyncio.run(bash.execute("ls -l"))
    print(rst)

View on GitHub (pinned to 52a13f2a57)

Solutions

  1. Default the command to a no-op or short-circuit before calling: if not command: return/skip — don't call execute() at all.
  2. Validate at the boundary of your calling code that the command string is non-empty and not None before dispatching to the tool.
  3. If you meant to recycle the shell, pass the literal string 'restart', not None.

Example fix

# before
await bash.execute(cmd)  # cmd may be None from an optional template field

# after
if not cmd:
    return CLIResult(system="skipped: empty command")
await bash.execute(cmd)
Defensive patterns

Strategy: validation

Validate before calling

if not command:
    return  # nothing to do — never call execute() with None

Type guard

def valid_bash_command(cmd: str | None) -> bool:
    return isinstance(cmd, str) and bool(cmd.strip())

Try / catch

try:
    await bash.execute(cmd)
except ToolError as e:
    if 'no command provided' in str(e):
        return  # skip empty commands silently at the orchestration layer
    raise

Prevention

When it happens

Trigger: Calling execute() with no arguments (or None) when a session already exists — note the code starts/creates the session first, then raises, so the call is wasted work; also hitting it when a caller passes command=None intending 'do nothing'.

Common situations: Orchestrators that build commands from templates and pass None on empty input; agent frameworks forwarding an optional field that was omitted in the request.

Related errors


AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15). Data as JSON: /api/errors/67ac592e22b0d7f2. Report an issue: GitHub.