runner

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package runner owns preflight, run directories and child process control.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Argv

func Argv(j jobs.Job, workdir, prompt string) []string

func Cancel

func Cancel(ctx context.Context, db *store.Store, data, id string) error

func OwnerStart

func OwnerStart() (time.Time, error)

OwnerStart uses the OS ps binary even when a job has a restricted PATH.

func Preamble

func Preamble(r store.Run, last *store.Run, data string, memoryLines ...string) string

func ProcessStart

func ProcessStart(pid int) (time.Time, error)

ProcessStart uses ps on both Linux and macOS (macOS has no /proc). ps lstart has second precision. Record the observed process start in proc_start and require equality before signalling: a later recycled PID must also be refused.

func RecoverClaimed

func RecoverClaimed(ctx context.Context, j jobs.Job, r *store.Run) error

RecoverClaimed removes a partial setup left by a dead owner.

func RemoveWorktree

func RemoveWorktree(ctx context.Context, repo string, r store.Run) error

func TeardownGroup

func TeardownGroup(pid int, c clock.Clock, grace time.Duration)

TeardownGroup drains descendants even after their group leader has been reaped.

func WorktreeChanges

func WorktreeChanges(ctx context.Context, path string) (string, error)

WorktreeChanges reports files and commits pruning would destroy. A commit is protected until it is reachable from a branch outside agentcron's run branches.

Types

type Runner

type Runner struct {
	DB                          *store.Store
	Clock                       clock.Clock
	DataDir, JobsDir, ConfigDir string
	Grace                       time.Duration
	Observe                     func(store.Run)
	// contains filtered or unexported fields
}

func (Runner) Run

func (x Runner) Run(ctx context.Context, j jobs.Job, r store.Run, approved bool) (store.Run, error)

Run records every pre-launch failure, including failures before preflight.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL