mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-21 00:05:49 +02:00
Preserve privileged ACP approval projection and delivered lifecycle
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
170652d2d4
commit
5aeebb20c9
5 files changed
+248
-5
No files matched your search
@@ -149,7 +149,12 @@ function runtimeRequestEntry(input: {
|
||||
const requestId = text(request.requestId) ?? text(input.payload.requestId);
|
||||
if (!requestId) return null;
|
||||
const suffix = input.eventType.split(".").at(-1);
|
||||
const rawStatus = text(request.status) ?? suffix;
|
||||
// The lifecycle event is authoritative. ACP delivery receipts carry
|
||||
// status:"delivered" in their payload, which must not reopen a resolved
|
||||
// request as pending just because it is not a UI lifecycle status.
|
||||
const rawStatus = suffix === "resolved" || suffix === "expired" || suffix === "cancelled"
|
||||
? suffix
|
||||
: text(request.status) ?? suffix;
|
||||
const resolvedAction = text(request.action)
|
||||
?? text(input.payload.action)
|
||||
?? input.previous?.resolvedAction
|
||||
|
||||
Reference in new issue
Block a user