monitor

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package monitor supervises a single agent child process (codex, Claude Code, or Cursor): it streams and parses output via the selected agent.Provider, maintains a live status file, and enforces the watchdog policy (heartbeat, stall ceiling, wall-clock timeout, cancellation).

The design deliberately drives each agent in its one-shot, non-interactive mode so the OS-level process exit is the authoritative completion signal, rather than a stream "done" event that can silently never arrive. To make that literally true, the monitor waits on the process (not on pipe EOF) and force-closes its own pipe read-ends if a lingering grandchild keeps them open — so the monitor can never itself hang silently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultThresholds

func DefaultThresholds() job.Thresholds

DefaultThresholds are the watchdog limits applied when a field is unset.

func Run

func Run(dir string, spec *job.Spec, opts Options) (*job.Status, error)

Run supervises codex to completion and returns the terminal status. The status file in dir is kept current throughout, so other processes can poll it.

Types

type Options

type Options struct {
	// Progress, if set, receives the same human-readable, timestamped lines
	// written to the job log (typically os.Stderr in foreground mode).
	Progress io.Writer
}

Options tune a foreground run; Progress may be nil for a detached worker.

Jump to

Keyboard shortcuts

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