Queue Messages
Sentinel uses five Cloudflare Queues plus a dead-letter queue for reliable inter-agent communication.
Queue Topology
Section titled “Queue Topology”LogTailer → [errors-detected] → TestGen → [triage-ready] → CodeTriage → [fix-ready] → FixAgent → [completed]
All failures → [sentinel-dlq]Queue Configuration
Section titled “Queue Configuration”| Queue | Binding | Batch | Timeout | Retries | Retry Delay | DLQ |
|---|---|---|---|---|---|---|
sentinel-errors-detected | ERRORS_DETECTED_QUEUE | 10 | 5s | 3 | 60s | sentinel-dlq |
sentinel-triage-ready | TRIAGE_READY_QUEUE | 5 | 10s | 3 | 120s | sentinel-dlq |
sentinel-fix-ready | FIX_READY_QUEUE | 1 | 30s | 2 | 300s | sentinel-dlq |
sentinel-trace-external | TRACE_EXTERNAL_QUEUE | 10 | 5s | 3 | 60s | sentinel-dlq |
sentinel-completed | COMPLETED_QUEUE | 10 | 5s | 1 | — | — |
sentinel-dlq | — | 10 | 10s | — | — | — |
Why batch_size: 1 for fix-ready?
Section titled “Why batch_size: 1 for fix-ready?”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.
Message Schemas
Section titled “Message Schemas”All messages are validated with Zod at both the producer (before queue.send()) and consumer (after receiving).
ErrorDetectedMessage
Section titled “ErrorDetectedMessage”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}TriageReadyMessage
Section titled “TriageReadyMessage”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}FixReadyMessage
Section titled “FixReadyMessage”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}CompletedMessage
Section titled “CompletedMessage”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}Dead Letter Queue
Section titled “Dead Letter Queue”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.