Overview
Session control commands allow you to manage task execution dynamically. You can pause tasks for inspection, resume them, stop the current task, or terminate the entire session. All control commands use the same endpoint but with different message payloads:newTask
Start a new task in the current session. This is the only control action that returns ataskId for result tracking.
Use REST for simple integrations, WebSocket for real-time event handling:
pollUrl to check status. Poll every 2-3 seconds until complete:
pause
Pause the current task. The agent will stop after completing its current action and wait for aresume command.
Use cases:
- Inspect the current state before continuing
- Wait for external conditions to be met
- Synchronize with other systems
The agent will complete its current action before pausing. It does not immediately halt mid-action.
resume
Resume a paused task. The agent will continue from where it left off.stop
Stop the current task immediately. The session remains active and ready for new tasks. Difference from terminate:stop: Ends the current task only, session stays activeterminate: Ends the entire session and all connections
- Task is taking too long
- Task is heading in wrong direction
- Need to intervene and start a different task