Versions in this module Expand all Collapse all v0 v0.1.0 Sep 19, 2026 Changes in this version + const ConventionalInitScript + const ConventionalTeardownScript + const DefaultHandoffTimeout + const DefaultRemoteConnectTimeout + const DefaultSuspendIdleTimeout + const DefaultTrashRetention + const DefaultWorktreeCleanupMaxAge + const DoneTaskCleanupTimeout + const HandoffPath + const PlacementChoiceReason + const RemoteInnerPrefix + const RemoteInnerPrefixHuman + const SpawnedAtOption + const TmuxDaemonSession + const TmuxOwnerOption + var ClaudeHookEvents = []string + var ConfigFileNames = []string + var ErrBranchBusy = errors.New("branch is checked out by a running step") + var ErrExecutorRestartLoop = errors.New(...) + var ErrMemoryPressure = errors.New("executor: deferring spawn, system memory pressure") + var ErrNoWorktree = errors.New("task has no worktree yet") + var ErrPlacedRemotely = errors.New("task is running on another machine") + var ErrRemoteTerminalEnded = errors.New("no remote executor session running for this task") + var ErrWorktreeMissing = errors.New("task worktree no longer exists") + func AgentSender(src WorkSource, daemonSession string, taskID int64) func(string) error + func AttachmentPrompt(paths []string) string + func CapturePaneContent(windowTarget string, lines int) string + func CapturePaneContentContext(ctx context.Context, windowTarget string, lines int) string + func ChoosePlacement(ctx context.Context, database *db.DB, task *db.Task, target, workDir string) error + func ClaudeConfigFilePath(dir string) string + func ClaudeSessionExists(sessionID, workDir, configDir string) bool + func ClaudeSettingsPath(workDir string) string + func CleanupClaudeSessions(worktreePath, configDir string) error + func DefaultClaudeConfigDir() string + func DefaultExecutorName() string + func DetectAuthPrompt(content string) (string, bool) + func DetectBlockingPrompt(content string) (string, bool) + func DetectBusy(content string) bool + func DetectStallNotice(content string) (string, bool) + func ExecutorBinaries(slug string) []string + func ExecutorsWithBinaries() []string + func FindClaudeSessionID(workDir string) string + func FormatSessionHandoff(prevExecutor, capturedContent string) string + func GetClaudePIDFromPane(paneID string) int + func GetTasksWithRunningShellProcess() map[int64]bool + func GetWorktreeInitScript(projectDir string) string + func GetWorktreeTeardownScript(projectDir string) string + func HandoffRequest(destination string) string + func HasLocalState(task *db.Task) (string, bool) + func HasRunningProcessInTaskUI() bool + func HiddenShellWindowName(taskID int64) string + func IsManagedWorktree(path string) bool + func KillAllWindowsByNameAllSessions(windowName string) + func KillTaskWindows(ctx context.Context, taskID int64) bool + func LocalOwnerTag() string + func ManagedWorktreeProjectDir(worktreePath string) string + func NormalizeClaudeConfigEnv() (removed string) + func PlacementChoices(ctx context.Context, database *db.DB, project, executorName string) []hooks.Host + func PurgeStaleClaudeProjectConfigs(configPath string) (int, error) + func RemoteAttachNotice(loc RemoteTaskLocation) string + func RemoteAttachScript(task *db.Task, loc RemoteTaskLocation) string + func RemoteEndedMessage(loc RemoteTaskLocation) string + func RemoteShellAttachScript(task *db.Task, loc RemoteTaskLocation) string + func RemoteTaskMessage(loc RemoteTaskLocation) string + func RemoteUnreachableMessage(loc RemoteTaskLocation) string + func RemoveClaudeProjectConfig(configPath, projectPath string) error + func RenameClaudeSession(workDir, newName, configDir string) error + func RequestHandoff(ctx context.Context, src WorkSource, task HandoffTask, destination string, ...) (string, bool) + func ResolveClaudeConfigDir(custom string) string + func SpawnLockDir() string + func StageAttachments(ctx context.Context, database *db.DB, taskID int64, workDir string, ...) ([]string, error) + func SupportsRemoteExecutor(name string) bool + func SyntheticHandoff(task HandoffTask, destination, because string) string + func TmuxSessionName(taskID int64) string + func TmuxWindowName(taskID int64) string + func WithRunner(ctx context.Context, r Runner) context.Context + func WorkflowStepFinished(worktreePath, baseCommit, baseDirty string) bool + func WorkflowStepUnfinishedReason(worktreePath, baseCommit, baseDirty string) string + func WorktreeAllowExternalWrites(projectDir string) []string + func WorktreeMCPConfigPath(taskID int64) string + type APIError struct + Message string + Status int + Transient bool + func LastAPIError(transcriptPath string) *APIError + func (e *APIError) String() string + type CarryReport struct + Branch string + Commit string + LeftBehind []string + WIPCommit bool + func CarryWork(ctx context.Context, src WorkSource, handoff, destination string) (CarryReport, error) + type ClaudeExecutor struct + func NewClaudeExecutor(e *Executor) *ClaudeExecutor + func (c *ClaudeExecutor) BuildCommand(task *db.Task, sessionID, prompt string) string + func (c *ClaudeExecutor) Execute(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + func (c *ClaudeExecutor) FindSessionID(workDir string) string + func (c *ClaudeExecutor) GetProcessID(taskID int64) int + func (c *ClaudeExecutor) IsAvailable() bool + func (c *ClaudeExecutor) Kill(taskID int64) bool + func (c *ClaudeExecutor) Name() string + func (c *ClaudeExecutor) Resume(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + func (c *ClaudeExecutor) ResumeDangerous(task *db.Task, workDir string) bool + func (c *ClaudeExecutor) ResumeSafe(task *db.Task, workDir string) bool + func (c *ClaudeExecutor) SessionExists(task *db.Task, sessionID string) bool + func (c *ClaudeExecutor) SupportsDangerousMode() bool + func (c *ClaudeExecutor) SupportsSessionResume() bool + type CodexExecutor struct + func NewCodexExecutor(e *Executor) *CodexExecutor + func (c *CodexExecutor) BuildCommand(task *db.Task, sessionID, prompt string) string + func (c *CodexExecutor) Execute(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + func (c *CodexExecutor) FindSessionID(workDir string) string + func (c *CodexExecutor) GetProcessID(taskID int64) int + func (c *CodexExecutor) IsAvailable() bool + func (c *CodexExecutor) Kill(taskID int64) bool + func (c *CodexExecutor) Name() string + func (c *CodexExecutor) Resume(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + func (c *CodexExecutor) ResumeDangerous(task *db.Task, workDir string) bool + func (c *CodexExecutor) ResumeSafe(task *db.Task, workDir string) bool + func (c *CodexExecutor) SupportsDangerousMode() bool + func (c *CodexExecutor) SupportsSessionResume() bool + type CursorExecutor struct + func NewCursorExecutor(e *Executor) *CursorExecutor + func (c *CursorExecutor) BuildCommand(task *db.Task, sessionID, prompt string) string + func (c *CursorExecutor) Execute(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + func (c *CursorExecutor) FindSessionID(workDir string) string + func (c *CursorExecutor) GetProcessID(taskID int64) int + func (c *CursorExecutor) IsAvailable() bool + func (c *CursorExecutor) Kill(taskID int64) bool + func (c *CursorExecutor) Name() string + func (c *CursorExecutor) Resume(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + func (c *CursorExecutor) ResumeDangerous(task *db.Task, workDir string) bool + func (c *CursorExecutor) ResumeSafe(task *db.Task, workDir string) bool + func (c *CursorExecutor) SupportsDangerousMode() bool + func (c *CursorExecutor) SupportsSessionResume() bool + type ExecResult struct + Interrupted bool + Message string + NeedsInput bool + Requeued bool + Success bool + type Executor struct + func New(database *db.DB, cfg *config.Config) *Executor + func NewWithLogging(database *db.DB, cfg *config.Config, w io.Writer) *Executor + func (e *Executor) AllExecutors() []string + func (e *Executor) ArchiveWorktree(task *db.Task) error + func (e *Executor) AuditWorktreePaths(fix bool) ([]WorktreePathIssue, error) + func (e *Executor) AvailableExecutors() []string + func (e *Executor) CleanupDuplicateWindows(taskID int64) + func (e *Executor) CleanupStaleWorktreesManual(maxAge time.Duration, dryRun bool) ([]*db.Task, error) + func (e *Executor) CleanupWorktree(task *db.Task) error + func (e *Executor) DisplayName() string + func (e *Executor) EnsureLocalWorktree(task *db.Task) (string, bool, error) + func (e *Executor) EnsureTaskWindow(ctx context.Context, task *db.Task, sessionID, handoffContext string) (string, bool, error) + func (e *Executor) ExecuteNow(ctx context.Context, taskID int64) error + func (e *Executor) ExecutorSlug() string + func (e *Executor) GetExecutor(name string) TaskExecutor + func (e *Executor) GetProjectDir(project string) string + func (e *Executor) GetTaskExecutor(task *db.Task) TaskExecutor + func (e *Executor) Interrupt(taskID int64) bool + func (e *Executor) IsClaudeRunning(taskID int64) bool + func (e *Executor) IsRunning(taskID int64) bool + func (e *Executor) KillClaudeProcess(taskID int64) bool + func (e *Executor) KillPiProcess(taskID int64) bool + func (e *Executor) NotifyTaskChange(eventType string, task *db.Task) + func (e *Executor) RemoteLocation(task *db.Task) (RemoteTaskLocation, bool) + func (e *Executor) RemoteSessionState(ctx context.Context, task *db.Task) RemoteSessionStatus + func (e *Executor) RenameClaudeSessionForTask(task *db.Task, newName string) + func (e *Executor) ResumeDangerous(taskID int64) bool + func (e *Executor) ResumeSafe(taskID int64) bool + func (e *Executor) ResumeWithMode(taskID int64, mode string) bool + func (e *Executor) RunningTasks() []int64 + func (e *Executor) Start(ctx context.Context) + func (e *Executor) Stop() + func (e *Executor) Subscribe(taskID int64) chan *db.TaskLog + func (e *Executor) SubscribeTaskEvents() chan TaskEvent + func (e *Executor) SuspendTaskSession(taskID int64) bool + func (e *Executor) TriggerProcessing() + func (e *Executor) UnarchiveWorktree(task *db.Task) error + func (e *Executor) Unsubscribe(taskID int64, ch chan *db.TaskLog) + func (e *Executor) UnsubscribeTaskEvents(ch chan TaskEvent) + type ExecutorFactory struct + func NewExecutorFactory() *ExecutorFactory + func (f *ExecutorFactory) All() []string + func (f *ExecutorFactory) Available() []string + func (f *ExecutorFactory) Get(name string) TaskExecutor + func (f *ExecutorFactory) Register(executor TaskExecutor) + type GeminiExecutor struct + func NewGeminiExecutor(e *Executor) *GeminiExecutor + func (g *GeminiExecutor) BuildCommand(task *db.Task, sessionID, prompt string) string + func (g *GeminiExecutor) Execute(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + func (g *GeminiExecutor) FindSessionID(workDir string) string + func (g *GeminiExecutor) GetProcessID(taskID int64) int + func (g *GeminiExecutor) IsAvailable() bool + func (g *GeminiExecutor) Kill(taskID int64) bool + func (g *GeminiExecutor) Name() string + func (g *GeminiExecutor) Resume(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + func (g *GeminiExecutor) ResumeDangerous(task *db.Task, workDir string) bool + func (g *GeminiExecutor) ResumeSafe(task *db.Task, workDir string) bool + func (g *GeminiExecutor) SupportsDangerousMode() bool + func (g *GeminiExecutor) SupportsSessionResume() bool + type GrokExecutor struct + func NewGrokExecutor(e *Executor) *GrokExecutor + func (g *GrokExecutor) BuildCommand(task *db.Task, sessionID, prompt string) string + func (g *GrokExecutor) Execute(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + func (g *GrokExecutor) FindSessionID(workDir string) string + func (g *GrokExecutor) GetProcessID(taskID int64) int + func (g *GrokExecutor) IsAvailable() bool + func (g *GrokExecutor) Kill(taskID int64) bool + func (g *GrokExecutor) Name() string + func (g *GrokExecutor) Resume(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + func (g *GrokExecutor) ResumeDangerous(task *db.Task, workDir string) bool + func (g *GrokExecutor) ResumeSafe(task *db.Task, workDir string) bool + func (g *GrokExecutor) SupportsDangerousMode() bool + func (g *GrokExecutor) SupportsSessionResume() bool + type HandoffTask struct + Host string + ID int64 + Title string + type LocalRunner struct + func (LocalRunner) Command(ctx context.Context, workDir, name string, args ...string) *exec.Cmd + func (LocalRunner) Target() string + type OpenClawExecutor struct + func NewOpenClawExecutor(e *Executor) *OpenClawExecutor + func (o *OpenClawExecutor) BuildCommand(task *db.Task, sessionID, prompt string) string + func (o *OpenClawExecutor) Execute(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + func (o *OpenClawExecutor) FindSessionID(workDir string) string + func (o *OpenClawExecutor) GetProcessID(taskID int64) int + func (o *OpenClawExecutor) IsAvailable() bool + func (o *OpenClawExecutor) Kill(taskID int64) bool + func (o *OpenClawExecutor) Name() string + func (o *OpenClawExecutor) Resume(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + func (o *OpenClawExecutor) ResumeDangerous(task *db.Task, workDir string) bool + func (o *OpenClawExecutor) ResumeSafe(task *db.Task, workDir string) bool + func (o *OpenClawExecutor) SupportsDangerousMode() bool + func (o *OpenClawExecutor) SupportsSessionResume() bool + type OpenCodeExecutor struct + func NewOpenCodeExecutor(e *Executor) *OpenCodeExecutor + func (o *OpenCodeExecutor) BuildCommand(task *db.Task, sessionID, prompt string) string + func (o *OpenCodeExecutor) Execute(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + func (o *OpenCodeExecutor) FindSessionID(workDir string) string + func (o *OpenCodeExecutor) GetProcessID(taskID int64) int + func (o *OpenCodeExecutor) IsAvailable() bool + func (o *OpenCodeExecutor) Kill(taskID int64) bool + func (o *OpenCodeExecutor) Name() string + func (o *OpenCodeExecutor) Resume(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + func (o *OpenCodeExecutor) ResumeDangerous(task *db.Task, workDir string) bool + func (o *OpenCodeExecutor) ResumeSafe(task *db.Task, workDir string) bool + func (o *OpenCodeExecutor) SupportsDangerousMode() bool + func (o *OpenCodeExecutor) SupportsSessionResume() bool + type PiExecutor struct + func NewPiExecutor(e *Executor) *PiExecutor + func (p *PiExecutor) BuildCommand(task *db.Task, sessionID, prompt string) string + func (p *PiExecutor) Execute(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + func (p *PiExecutor) FindSessionID(workDir string) string + func (p *PiExecutor) GetProcessID(taskID int64) int + func (p *PiExecutor) IsAvailable() bool + func (p *PiExecutor) Kill(taskID int64) bool + func (p *PiExecutor) Name() string + func (p *PiExecutor) Resume(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + func (p *PiExecutor) ResumeDangerous(task *db.Task, workDir string) bool + func (p *PiExecutor) ResumeSafe(task *db.Task, workDir string) bool + func (p *PiExecutor) SupportsDangerousMode() bool + func (p *PiExecutor) SupportsSessionResume() bool + type PlacementConfig struct + RemoteRequired bool + type PlacementResult struct + Messages []string + func PlaceTask(ctx context.Context, database *db.DB, taskID int64, target, workDir string, ...) (PlacementResult, error) + type ProjectConfig struct + Placement PlacementConfig + Worktree WorktreeConfig + func LoadProjectConfig(projectDir string) (*ProjectConfig, error) + type RemoteRunner struct + ConnectTimeout time.Duration + Host string + SSHBin string + WorkDir string + func (r RemoteRunner) Command(ctx context.Context, workDir, name string, args ...string) *exec.Cmd + func (r RemoteRunner) Preflight(ctx context.Context) (string, error) + func (r RemoteRunner) Target() string + type RemoteSessionStatus int + const RemoteSessionEnded + const RemoteSessionLive + const RemoteSessionUnreachable + type RemoteTaskLocation struct + Attach string + Branch string + Host string + WorkDir string + type RemoteTerminal struct + AgentPaneID string + ShellPaneID string + WindowTarget string + func InspectRemoteTerminal(ctx context.Context, task *db.Task, workdir string, ensureShell bool) (RemoteTerminal, error) + type Runner interface + Command func(ctx context.Context, workDir, name string, args ...string) *exec.Cmd + Target func() string + func DefaultRunner() Runner + func RunnerFrom(ctx context.Context) Runner + type TaskEvent struct + Task *db.Task + TaskID int64 + Type string + type TaskExecutor interface + BuildCommand func(task *db.Task, sessionID, prompt string) string + Execute func(ctx context.Context, task *db.Task, workDir, prompt string) ExecResult + FindSessionID func(workDir string) string + GetProcessID func(taskID int64) int + IsAvailable func() bool + Kill func(taskID int64) bool + Name func() string + Resume func(ctx context.Context, task *db.Task, workDir, prompt, feedback string) ExecResult + ResumeDangerous func(task *db.Task, workDir string) bool + ResumeSafe func(task *db.Task, workDir string) bool + SupportsDangerousMode func() bool + SupportsSessionResume func() bool + type WorkSource struct + Host string + Runner Runner + WorkDir string + func (s WorkSource) Where() string + type WorktreeConfig struct + AllowExternalWrites []string + InitScript string + TeardownScript string + type WorktreeGuardDecision struct + Decision string + Reason string + func EvaluateWorktreeWriteGuard(worktreePath string, allowExternal []string, in WorktreeGuardInput) *WorktreeGuardDecision + type WorktreeGuardInput struct + Cwd string + PermissionMode string + ToolInput json.RawMessage + ToolName string + type WorktreePathIssue struct + Field string + Fixed bool + Path string + Project string + Reason string + TaskID int64 + Title string