Skip to content

Queue Messages

Sentinel uses five Cloudflare Queues plus a dead-letter queue for reliable inter-agent communication.

LogTailer → [errors-detected] → TestGen → [triage-ready] → CodeTriage
→ [fix-ready] → FixAgent → [completed]
All failures → [sentinel-dlq]
QueueBindingBatchTimeoutRetriesRetry DelayDLQ
sentinel-errors-detectedERRORS_DETECTED_QUEUE105s360ssentinel-dlq
sentinel-triage-readyTRIAGE_READY_QUEUE510s3120ssentinel-dlq
sentinel-fix-readyFIX_READY_QUEUE130s2300ssentinel-dlq
sentinel-trace-externalTRACE_EXTERNAL_QUEUE105s360ssentinel-dlq
sentinel-completedCOMPLETED_QUEUE105s1
sentinel-dlq1010s

The FixAgent clones repositories, creates branches, and pushes commits. Running multiple fix attempts concurrently on the same repo would cause Git conflicts. Serial processing (batch_size: 1) ensures each fix runs in isolation.

All messages are validated with Zod at both the producer (before queue.send()) and consumer (after receiving).

Queue: sentinel-errors-detected Producer: LogTailer Consumer: TestGen

{
fingerprint: string, // SHA-256 hex (64 chars)
incidentId: string, // ULID
serviceName: string, // Worker name
triggerRoute: string, // e.g., "/api/users/:id"
errorClass: ErrorClass, // "client_4xx" | "server_5xx" | "unhandled_exception"
sampleEvent: ObservabilityEvent,
occurrenceCount: number, // >= 1
firstSeen: string, // ISO 8601
lastSeen: string // ISO 8601
}

Queue: sentinel-triage-ready Producer: TestGen Consumer: CodeTriage

{
incidentId: string,
fingerprint: string,
serviceName: string,
repoUrl: string, // GitHub HTTPS URL
testCaseR2Key: string, // "incidents/{id}/test-case.ts"
testResultR2Key: string, // "incidents/{id}/test-result.json"
reproductionConfirmed: boolean,
sampleEvent: ObservabilityEvent
}

Queue: sentinel-fix-ready Producer: CodeTriage Consumer: FixAgent

{
incidentId: string,
fingerprint: string,
serviceName: string,
repoUrl: string,
commitSha: string, // HEAD at time of triage
testCaseR2Key: string,
triageResult: {
rootCauseFile: string,
rootCauseLines: [number, number],
rootCauseExplanation: string,
fixStrategy: string,
confidence: "high" | "medium" | "low",
affectedFiles: string[]
},
githubIssueNumber: number
}

Queue: sentinel-completed Producer: FixAgent Consumer: Completion handler (log and ack)

{
incidentId: string,
fingerprint: string,
serviceName: string,
status: "resolved" | "wontfix" | "needs_human",
githubPrNumber?: number,
githubPrUrl?: string
}

Failed messages from any queue (after exhausting retries) are sent to sentinel-dlq. The DLQ handler logs the full message body, timestamp, and attempt count to console.error, then acknowledges.

In a future phase, DLQ messages may trigger alerts or be written to D1 for investigation.