Documentation
¶
Overview ¶
Package worker provides process-isolated task execution for Drover
Index ¶
Constants ¶
const DefaultTimeout = 30 * time.Minute
DefaultTimeout is the default task execution timeout
const HeartbeatInterval = 10 * time.Second
HeartbeatInterval is how often to send heartbeats
const SlowThreshold = 10 * time.Second
SlowThreshold is the response time threshold for slow response detection
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI represents the worker command-line interface
type DebugMessage ¶
DebugMessage is sent to stderr in verbose mode
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor handles the actual task execution
func NewExecutor ¶
NewExecutor creates a new worker executor
func (*Executor) Execute ¶
func (e *Executor) Execute(input *TaskInput) *TaskResult
Execute runs a task and returns the result
type HeartbeatMessage ¶
type HeartbeatMessage struct {
Type string `json:"type"`
TaskID string `json:"task_id"`
Timestamp int64 `json:"timestamp"`
}
HeartbeatMessage is sent periodically to stderr for crash recovery
type ProgressMessage ¶
type ProgressMessage struct {
Type string `json:"type"`
TaskID string `json:"task_id"`
Message string `json:"message"`
}
ProgressMessage is sent to stderr for progress updates
type TaskInput ¶
type TaskInput struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
EpicID string `json:"epic_id,omitempty"`
Worktree string `json:"worktree"`
Guidance []string `json:"guidance,omitempty"`
Timeout string `json:"timeout,omitempty"`
ClaudePath string `json:"claude_path,omitempty"`
Verbose bool `json:"verbose,omitempty"`
MemoryLimit string `json:"memory_limit,omitempty"`
}
TaskInput represents the input for a worker task execution
type TaskResult ¶
type TaskResult struct {
Success bool `json:"success"`
TaskID string `json:"task_id"`
Output string `json:"output"`
Error string `json:"error,omitempty"`
DurationMs int64 `json:"duration_ms"`
Signal WorkerSignal `json:"signal"`
Verdict string `json:"verdict,omitempty"`
VerdictReason string `json:"verdict_reason,omitempty"`
}
TaskResult represents the output of a worker task execution
type WorkerSignal ¶
type WorkerSignal = backpressure.WorkerSignal
WorkerSignal is an alias for backpressure.WorkerSignal
const ( SignalOK WorkerSignal = backpressure.SignalOK SignalRateLimited WorkerSignal = backpressure.SignalRateLimited SignalSlowResponse WorkerSignal = backpressure.SignalSlowResponse SignalAPIError WorkerSignal = backpressure.SignalAPIError )
Signal constants are re-exported from backpressure package