mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 01:50:13 +01:00
fix: retry reviewed chat setup after temporary contention (#19787)
Retry reviewed chat preparation with the original accepted input. Bound retries for authorization proof waits that expire before provider work. Preserve the original answer receipt and queue later wakes separately. Keep plan confirmation semantics by assigning the interaction marker only to question answer delivery and legacy question payloads. Verification: 433 tests across four backend suites, all 17 project-chat browser tests, and all server source/test typecheck layers passed. The plan approval regression was reproduced on the previous head before the fix. All applicable CI passed and exact-head Greptile Apex scored 5/5. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
27170dca49
commit
bf12b2d8ad
16 files changed
+405
-28
No files matched your search
@@ -83,12 +83,20 @@ export function wakeMustNotJoinActiveRun(
|
||||
): boolean {
|
||||
// A context compaction run does no task work, so ordinary wakes and
|
||||
// compactions never merge, in either arrival order.
|
||||
return interactionReceipt || Boolean(parseObject(activeRunContext).interactionId) ||
|
||||
return hasRetainedExternalChatRetry(activeRunContext) || interactionReceipt || Boolean(parseObject(activeRunContext).interactionId) ||
|
||||
Boolean(readNonEmptyString(parseObject(activeRunContext).contextCompactionRequestId)) ||
|
||||
Boolean(readNonEmptyString(wakeContext.contextCompactionRequestId)) ||
|
||||
wakeChatConversationsConflict(activeRunContext, wakeContext);
|
||||
}
|
||||
|
||||
export function hasRetainedExternalChatRetry(context: unknown): boolean {
|
||||
const active = parseObject(context);
|
||||
const activeSource = readNonEmptyString(active.source);
|
||||
return readNonEmptyString(active.retryOfRunId) !== null &&
|
||||
(activeSource?.startsWith("chat:") === true ||
|
||||
(activeSource === "issue.interaction.respond" && active.externalChatContinuation === true));
|
||||
}
|
||||
|
||||
function isInteractionResolutionWakePayload(payload: Record<string, unknown> | null | undefined): boolean {
|
||||
return readNonEmptyString(payload?.mutation) === "interaction";
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ export type {
|
||||
RunSummary,
|
||||
} from "./application/types.js";
|
||||
export { WakeQueueApplicationError } from "./application/types.js";
|
||||
export { hasRetainedExternalChatRetry } from "./domain/context.js";
|
||||
export type {
|
||||
IssueSnapshot,
|
||||
RunSnapshot,
|
||||
|
||||
Reference in new issue
Block a user