Documentation
¶
Overview ¶
Package agentrun orchestrates the coding-agent stages inside the Job pod: render the prompts, drive the classification harness, decide whether to continue, drive the remediation harness under a token-budget kill switch, verify and package the resulting changeset, and report every stage as an envelope event on stdout.
The runner trusts the repository over the agent: a remediation report claiming success is downgraded unless commit.sh ran cleanly and left real commits on the branch. It never talks to GitHub — the pod has no GitHub credentials by design; the remediation-controller owns every side effect.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent drives the stages.
type Config ¶
type Config struct {
Workspace string
Repo string
Issue int
Phase Phase
ClassifyHarness string
RemediateHarness string
ClassifyModel string
// RemediateModel is the model the remediation stage runs on when the
// classification's suggestion is missing or not allowlisted.
RemediateModel string
ModelAllowlist []string
// The classification stage's limits are absolute: it runs on exactly
// these. The remediation stage's are ceilings — the classification
// requests its own max_turns and token_budget, and Agent.clamp holds
// those requests to these bounds.
ClassifyMaxTurns int
ClassifyTokenBudget int
RemediateMaxTurns int
RemediateTokenBudget int
ClassifyTimeout time.Duration
RemediateTimeout time.Duration
ConfidenceThreshold float64
// DefaultBranch is the clone's base branch (bundle base).
DefaultBranch string
BundleMaxBytes int
// Out receives the envelope events (stdout in the pod).
Out io.Writer
Log *slog.Logger
}
Config is the runner's configuration; in the pod every field arrives as PATCHY_* environment (see FromEnv).
type Executor ¶
type Executor interface {
Run(ctx context.Context, spec runner.CommandSpec, timeout time.Duration,
onLine func([]byte) (bool, string)) (runner.Result, error)
}
Executor runs harness command specs; *runner.Exec satisfies it, tests fake it.