Skip to content

Failed sessions_spawn creates workspace directory from error message string #31311

@Tristyan

Description

@Tristyan

Description

When is called with a non-existent agent ID, OpenClaw creates a workspace directory using the error message string as the path name.

Evidence

During an investigation on 2026-03-02, the following ghost directories were discovered in the workspace root:
1.
2.

Impact

These directories contained nested repositories which triggered a cascading logical loop in a sub-agent health-check cron (). This resulted in a runaway session consuming 32,000 output tokens (~/bin/zsh.01-0.08 cost depending on provider) and significant filesystem noise (100+ staged files).

Expected Behavior

should fail with an error and return to the requester without creating any filesystem artifacts if the is invalid.

Environment

  • Version: 2026.2.26 (confirmed)
  • OS: Darwin 25.3.0 (arm64)
  • Runtime: node v25.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions