mirror of
https://github.com/morluto/rea.git
synced 2026-11-06 23:06:18 +00:00
fix(evidence): report partial workflow question publication (#8848)
* fix(evidence): report partial workflow question publication * fix: project nested recovery for caller lifetime
This commit is contained in:
1 parent
b97023809f
commit
6df2ac1d7e
9 files changed
+363
-27
No files matched your search
@@ -292,7 +292,12 @@ const executeEnhancedTool = async (
|
||||
registration.recordEvidence,
|
||||
result,
|
||||
);
|
||||
await reportOperationEnd(progress, name, result.ok);
|
||||
const finish = async (
|
||||
response: CallToolResult,
|
||||
): Promise<CallToolResult> => {
|
||||
await reportOperationEnd(progress, name, response.isError !== true);
|
||||
return response;
|
||||
};
|
||||
if (result.ok) {
|
||||
const evidence = createWorkflowEvidence({
|
||||
target: registration.activeTarget?.(),
|
||||
@@ -307,7 +312,9 @@ const executeEnhancedTool = async (
|
||||
});
|
||||
const recorded = registration.recordEvidence?.(evidence);
|
||||
if (recorded !== undefined && !recorded.ok)
|
||||
return registration.delivery.toCallToolResult(recorded, contract);
|
||||
return finish(
|
||||
registration.delivery.toCallToolResult(recorded, contract),
|
||||
);
|
||||
if (
|
||||
name !== "trace_native_ui_action" &&
|
||||
registration.allowsSnapshotReplay?.(name) === true
|
||||
@@ -322,7 +329,9 @@ const executeEnhancedTool = async (
|
||||
const snapshot =
|
||||
registration.recordWorkflowSnapshot?.(workflowRecord);
|
||||
if (snapshot !== undefined && !snapshot.ok)
|
||||
return registration.delivery.toCallToolResult(snapshot, contract);
|
||||
return finish(
|
||||
registration.delivery.toCallToolResult(snapshot, contract),
|
||||
);
|
||||
}
|
||||
}
|
||||
const unknowns = recordWorkflowUnknowns({
|
||||
@@ -330,9 +339,12 @@ const executeEnhancedTool = async (
|
||||
result: result.value.result,
|
||||
evidenceId: evidence.evidence_id,
|
||||
recordUnknown: registration.recordUnknown,
|
||||
evidenceRetained: recorded?.ok === true,
|
||||
});
|
||||
if (!unknowns.ok)
|
||||
return registration.delivery.toCallToolResult(unknowns, contract);
|
||||
return finish(
|
||||
registration.delivery.toCallToolResult(unknowns, contract),
|
||||
);
|
||||
const delivered =
|
||||
request.detail === "summary"
|
||||
? summarizeRetainedAnalysis(evidence, {
|
||||
@@ -341,16 +353,22 @@ const executeEnhancedTool = async (
|
||||
})
|
||||
: ok(evidence);
|
||||
if (!delivered.ok)
|
||||
return registration.delivery.toCallToolResult(delivered, contract);
|
||||
return registration.delivery.toEvidenceToolResult(
|
||||
delivered.value,
|
||||
contract,
|
||||
request.detail === "summary"
|
||||
? registration.recordEvidence?.(delivered.value)
|
||||
: recorded,
|
||||
return finish(
|
||||
registration.delivery.toCallToolResult(delivered, contract),
|
||||
);
|
||||
return finish(
|
||||
registration.delivery.toEvidenceToolResult(
|
||||
delivered.value,
|
||||
contract,
|
||||
request.detail === "summary"
|
||||
? registration.recordEvidence?.(delivered.value)
|
||||
: recorded,
|
||||
),
|
||||
);
|
||||
}
|
||||
return deliverEnhancedFailure(registration, contract, result.error);
|
||||
return finish(
|
||||
deliverEnhancedFailure(registration, contract, result.error),
|
||||
);
|
||||
},
|
||||
);
|
||||
return admitted.ok
|
||||
|
||||
Reference in new issue
Block a user