Expand description
Task runner — executes tasks using AI agents.
Replaces run_task.sh with pure Rust. The runner:
- Sets up a git worktree for isolation
- Builds context (project instructions, skills, comments)
- Renders prompts and spawns the agent in tmux
- Waits for completion, collects and classifies the response
- Handles errors (reroute on limits, fallback agents)
- Auto-commits, pushes, and creates PRs
- Updates status labels and posts result comments
Submodules handle the heavy lifting:
task_init— guard checks, worktree setup, and invocation buildingsession— tmux session lifecycle and output collectionresponse_handler— success path: commit, push, PR, token storagefallback— error classification and recovery strategies
Re-exports§
pub use response::WeightSignal;
Modules§
- agent
- Agent command building + tmux invocation.
- agents
- Per-agent runner trait, error types, and agent registry.
- context
- Context building for task execution.
- cow
- Copy-on-write task worktrees cloned from a per-project template by the git-cow crate, see docs/content/cow-worktrees.md
- diff
- direct
- One-shot agent invocation without tmux.
- fallback
- Error recovery and fallback strategies.
- git_ops
- Git operations — auto-commit, push, PR creation.
- response
- Response collection + error classification.
- response_
handler - Success-path response handler — commit, push, PR, token storage.
- session
- Agent session management — spawn, wait for completion, collect output.
- task_
init - Task initialization — guard checks, worktree setup, and invocation building.
- worktree
- Git worktree management for task execution.
Structs§
- RunAudit
- Fully materialized task-run audit data.
- RunExecution
- Result returned by
run()so callers can persist the audit trail. - Task
Runner - Task runner configuration.
Functions§
- parse_
session_ output - Tries
parse_success_outputfirst when stdout is non-empty. If that succeeds, returns success regardless of exit code. If it fails andexit_code != 0, checks for"terminal_reason":"completed"or cost-telemetry-only stdout ("costUSD":) before falling back toclassify_error, so valid sessions that exit 1 produceInvalidResponse(soft error, re-route) instead of a garbledUnknown/Autherror (hard failure with spurious cooldown)