tt restart
Restart a stopped agent with fresh rounds.
Synopsis
tt restart <AGENT> [OPTIONS]
Description
Restarts an agent that is in a terminal state (Stopped or Error). Resets the agentβs state to Idle, clears any stop flags, and spawns a new agent process with fresh rounds.
The agent must already exist and be stopped. To create a new agent, use tt spawn.
Arguments
| Argument | Description |
|---|---|
AGENT | Name of the agent to restart |
Options
| Option | Description |
|---|---|
--rounds <N> | Maximum rounds for restarted agent (default: 10) |
--foreground | Run in foreground instead of backgrounding |
--town <PATH> | Town directory (default: .) |
--verbose | Enable verbose logging |
Examples
Basic Restart
tt restart worker-1
Output:
π Restarting agent 'worker-1'...
Rounds: 10
Log: .tt/logs/worker-1.log
β
Agent 'worker-1' restarted
Restart with More Rounds
tt restart worker-1 --rounds 20
Restart in Foreground
tt restart worker-1 --foreground
# Agent runs in terminal, you see all output
Error: Agent Still Active
tt restart worker-1
Output:
β Agent 'worker-1' is still active (Working)
Use 'tt kill worker-1' to stop it first
Error: Agent Not Found
tt restart nonexistent
Output:
β Agent 'nonexistent' not found
Restart vs Spawn
| Command | Use Case |
|---|---|
tt restart | Revive existing stopped agent (keeps ID) |
tt spawn | Create brand new agent (new ID) |
Common Workflow
After agent exhausts its rounds:
# Check status
tt status
# Shows: worker-1 (Stopped) - completed 10/10 rounds
# Restart with more rounds
tt restart worker-1 --rounds 15
See Also
- tt spawn β Create new agents
- tt kill β Stop agents gracefully
- tt recover β Mark orphaned agents as stopped