Type Definitions
Shared domain types for the Longshot multi-agent system.Task
Represents a task assigned by a planner to a worker agent.Fields
Unique task ID (UUID format)
Parent task ID if this is a subtask
Natural language description of what to do
File paths the worker should focus on
Natural language criteria for how to know when the task is complete
Git branch name for this task
Current task status. See TaskStatus
Sandbox ID of the assigned worker
Unix timestamp in milliseconds when task was created
Unix timestamp in milliseconds when task execution started
Unix timestamp in milliseconds when task was completed
Priority level from 1 (highest) to 10 (lowest)
Original branch that conflicted (for conflict-fix tasks)
Number of times this task has been retried (0 = first attempt)
TaskStatus
Task lifecycle status.| Value | Description |
|---|---|
pending | Task created but not yet assigned |
assigned | Task assigned to a worker |
running | Task currently being executed |
complete | Task successfully completed |
failed | Task execution failed |
cancelled | Task was cancelled |
AgentRole
Agent role types in the multi-agent system.| Value | Description |
|---|---|
root-planner | Top-level planning agent |
subplanner | Nested planning agent for task decomposition |
worker | Code execution agent |
reconciler | Conflict resolution agent |
Handoff
Report from a worker back to the planner after completing (or attempting) a task.Fields
ID of the task being reported on
Completion status:
complete, partial, blocked, or failedDescription of what was accomplished
Git diff output showing all changes
List of file paths that were modified
Issues or problems discovered during execution
Recommendations for the planner
Execution metrics including:
linesAdded: Number of lines addedlinesRemoved: Number of lines removedfilesCreated: Number of new files createdfilesModified: Number of existing files modifiedtokensUsed: Total LLM tokens consumedtoolCallCount: Number of tool calls madedurationMs: Execution duration in milliseconds
Exit code from
tsc --noEmit post-agent build check. null if check did not runSandboxStatus
Worker sandbox status and health information.Fields
Unique identifier for the sandbox
Current sandbox state:
starting, ready, working, completing, terminated, or errorID of task currently being executed
Human-readable description of current activity
Health monitoring data:
lastPing: Unix timestamp in milliseconds of last health checkconsecutiveFailures: Number of consecutive failed health checks
Tunnel URL for HTTP access to the sandbox
HarnessConfig
Configuration for the Longshot harness system.Fields
Maximum number of concurrent worker sandboxes
Worker execution timeout in milliseconds
Git merge strategy:
fast-forward, rebase, or merge-commitLLM configuration:
endpoints: Array of LLM endpoints (see LLMEndpoint)model: Model name to usemaxTokens: Maximum tokens per requesttemperature: Sampling temperature (0-1)timeoutMs: Optional request timeout in milliseconds
Git repository configuration:
repoUrl: Repository URLmainBranch: Main branch name (e.g., “main” or “master”)branchPrefix: Prefix for task branches
Sandbox environment configuration:
imageTag: Docker image tag to usecpuCores: Number of CPU cores to allocatememoryMb: Memory limit in megabytesidleTimeout: Idle timeout in milliseconds
LLMEndpoint
LLM endpoint configuration with load balancing weight.Fields
Human-readable endpoint name
API endpoint URL
Optional API key for authentication
Load balancing weight (higher = more requests)
LogEntry
Structured log entry for NDJSON logging.Fields
Unix timestamp in milliseconds
Log level:
debug, info, warn, or errorUnique identifier for the logging agent
Role of the logging agent
Optional task ID if log is task-specific
Log message
Optional structured data payload
MetricsSnapshot
System-wide metrics snapshot.Fields
Unix timestamp in milliseconds when snapshot was taken
Number of currently active worker sandboxes
Number of tasks waiting to be assigned
Number of tasks currently being executed
Number of successfully completed tasks
Number of failed tasks
Number of tasks flagged as suspicious
Commit velocity metric
Percentage of successful merges (0-1)
Total LLM tokens consumed across all tasks
Estimated total cost in USD
Number of tool calls currently in progress
Estimated tokens in active requests
Number of finalization attempts (populated after finalization)
Whether the finalization build check passed
Whether the finalization tests passed
Whether all tasks were successfully merged
Number of tasks that failed to merge
Duration of finalization phase in milliseconds