Data models
Task
interface Task { id: string; status: "queued" | "running" | "complete" | "failed"; repo: string; issueNumber: number; agent: string; prompt: string; machineId?: string; prUrl?: string; createdAt: Date; completedAt?: Date; error?: string;}Field intent:
id: globally unique task identifier.status: current lifecycle phase.machineId: Fly runtime handle for operational introspection.prUrl: set when task results in a pull request.error: terminal failure details for UI and debugging.
User config
interface UserConfig { flyToken: string; anthropicKey: string; ampKey?: string; openaiKey?: string; defaultAgent: string;}Notes
statustracks the end-to-end execution lifecycle.machineIdlinks a task to Fly runtime state.prUrlis set when agent execution results in a pull request.
Modeling recommendations
- Keep status enum small and explicit.
- Use nullable optional fields for runtime-dependent metadata.
- Store timestamps in UTC and render locale at presentation time.
Extension ideas
- Add
durationMsfor performance analytics. - Add
attemptfor retries and replay workflows. - Add
actormetadata to correlate request ownership and audit trails.