Skip to content

[Feature] Add /stop command to cancel running tasks #2009

@ch1bug

Description

@ch1bug

🎯 The Goal / Use Case

Currently, when PicoClaw is executing a long-running task (e.g., web search, file operations, complex reasoning), there is no way for the user to cancel or stop the task mid-execution.

Use Cases:

  • User accidentally triggers a time-consuming operation
  • User realizes the request was incorrect after submission
  • Task is taking too long and user wants to abort
  • User needs to free up resources for more urgent tasks

💡 Proposed Solution

Add a /stop command that:

  1. Interrupts the current task execution
  2. Cleans up any pending operations
  3. Returns control to the user immediately
  4. Optionally saves partial results if applicable

Expected Behavior:

User: /stop
PicoClaw: ⏹️ Task stopped. [Task name] was cancelled.

🛠 Potential Implementation (Optional)

  • Add signal handling (SIGINT/SIGTERM) to task execution pipeline
  • Implement context cancellation in Go routines
  • Add command parser recognition for /stop
  • Ensure graceful cleanup of resources (file handles, network connections)

🚦 Impact & Roadmap Alignment

  • This is a Core Feature
  • This is a Nice-to-Have / Enhancement
  • This aligns with the current Roadmap

🔄 Alternatives Considered

  1. Timeout-based auto-cancellation: Set max execution time per task

    • Cons: Doesn't give user control, may cut off valid long tasks
  2. Restart the service: Kill and restart PicoClaw

    • Cons: Heavy-handed, loses all context and state
  3. Platform-specific stop buttons: Add UI buttons in Telegram/Discord

    • Cons: Not universal, requires per-platform implementation

💬 Additional Context

This feature would improve user experience by providing:

  • Better control over AI assistant behavior
  • Reduced resource waste on unwanted tasks
  • More responsive interaction model

Similar commands exist in other AI assistants and CLI tools (e.g., Ctrl+C, /cancel, /abort).


Environment:

  • Version: 0.2.4
  • Platform: Telegram (primary), multi-channel support needed
  • OS: Linux ARM64 (EdgePi)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions