mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-07 07:55:47 +01:00
Stop one-second scans of failed chat-run retries. Wake the existing retry queue after transaction commits and at saved retry or stale-claim deadlines. Preserve claim fences, authorization, recovery, and idempotent agent admission. Resolve conflicts with the current chat-service extraction by applying the retry signals and shared deadline predicate in the failed-run retry module. Verified with pnpm typecheck, pnpm build, all 1,328 chat and coordinator regression tests, and current-head CI. Greptile reviewed the final head at 5/5 with no unresolved threads. Co-Authored-By: Paperclip <noreply@paperclip.ing>
39 lines
1.6 KiB
TypeScript
39 lines
1.6 KiB
TypeScript
import { DELIVERY_QUEUES, notifyDeliveryWork } from "./delivery-work-notifications.js";
|
|
|
|
export async function notifyChatDeliveryWork(tx: object): Promise<void> {
|
|
await notifyDeliveryWork(tx, DELIVERY_QUEUES.chatInbound);
|
|
}
|
|
|
|
export async function notifyChatPublicationWork(tx: object): Promise<void> {
|
|
await notifyDeliveryWork(tx, DELIVERY_QUEUES.chatPublications);
|
|
// Receipt recovery waits for the publication owner to release its claim.
|
|
await notifyDeliveryWork(tx, DELIVERY_QUEUES.chatReceipts);
|
|
}
|
|
|
|
export const CHAT_ACTION_QUEUES = {
|
|
provider_effect: DELIVERY_QUEUES.chatProviderEffects,
|
|
github_webhook_ingress: DELIVERY_QUEUES.chatGitHubIngress,
|
|
failed_run_retry: DELIVERY_QUEUES.chatFailedRunRetries,
|
|
slack_session_sync: DELIVERY_QUEUES.chatSessionSyncs,
|
|
slack_board_message: DELIVERY_QUEUES.chatBoardMessages,
|
|
slash_task_start: DELIVERY_QUEUES.chatTaskStarts,
|
|
receipt_reaction: DELIVERY_QUEUES.chatReceiptReactions,
|
|
slack_session_stop: DELIVERY_QUEUES.chatSessionStops,
|
|
} as const;
|
|
export type ScheduledChatAction = keyof typeof CHAT_ACTION_QUEUES;
|
|
|
|
export async function notifyChatActionWork(tx: object, kind: ScheduledChatAction): Promise<void> {
|
|
await notifyDeliveryWork(tx, CHAT_ACTION_QUEUES[kind]);
|
|
}
|
|
|
|
export async function notifyChatVerificationWork(tx: object): Promise<void> {
|
|
await notifyDeliveryWork(tx, DELIVERY_QUEUES.chatVerification);
|
|
}
|
|
|
|
export async function notifyChatEndpointWork(tx: object): Promise<void> {
|
|
await notifyChatDeliveryWork(tx);
|
|
await notifyChatPublicationWork(tx);
|
|
for (const queue of Object.values(CHAT_ACTION_QUEUES)) await notifyDeliveryWork(tx, queue);
|
|
await notifyChatVerificationWork(tx);
|
|
}
|