Lifecycle
When you runstrawpot start:
- Load config — Merge global, project, and CLI flag settings
- Resolve agent — Find the agent runtime (builtin → global → project)
- Validate — Check required tools and environment variables
- Create isolation — Set up worktree or use project directory directly
- Start Denden — Launch gRPC server on
127.0.0.1:9700 - Resolve orchestrator role — Fetch from StrawHub, stage dependencies
- Spawn orchestrator — Launch the agent in tmux (or direct terminal)
- Block — Wait for the orchestrator to exit
- Cleanup — Kill sub-agents, stop Denden, merge changes, remove worktree
.strawpot/sessions/<session_id>/session.json.
Merge Strategies
When a session ends with worktree isolation, changes need to be merged back. Themerge_strategy config controls how:
| Strategy | Behavior |
|---|---|
auto | Detect remote: use pr if remote exists, local otherwise |
local | Generate a patch from the session branch, apply to the base branch |
pr | Push session branch, create PR via gh (or custom command) |
Local Merge
- Generate patch:
git diff base_branch...session_branch - Switch to base branch
- Apply patch with
git apply - If conflicts arise, prompt user for resolution
PR Merge
- Push session branch to remote
- Run the PR command (configurable):
- The
pr_commandconfig supports{base_branch}and{session_branch}placeholders
Pull Before Session
Thepull_before_session setting controls whether to pull latest changes before creating a worktree:
| Value | Behavior |
|---|---|
prompt | Ask the user each time (default) |
auto | Pull if a remote is detected |
always | Force pull (error if no remote) |
never | Skip, use current HEAD |
Crash Recovery
If StrawPot crashes or is interrupted, sessions may be left in a stale state. On the nextstrawpot start, StrawPot automatically:
- Scans
.strawpot/sessions/for stale session files - Checks if the session’s PID is still alive
- For dead sessions: applies the merge strategy and cleans up the worktree
- Removes orphaned session files
Monitoring
- Session ID, start time, working directory
- Denden server address and PID
- All spawned agents with their role, runtime, parent, and status