mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 19:07:41 +00:00
fix(orchestration): keep locator fields when stripping copies; never let the optional receipt page block remote release
This commit is contained in:
+3
@@ -19,6 +19,9 @@ try {
|
||||
"UPDATE worker_terminal_archives SET content = CASE WHEN json_valid(content) THEN json_patch('{\\"version\\":3}', json_object(" +
|
||||
"'agent', json_extract(content, '$.agent'), " +
|
||||
"'processIncarnation', json_extract(content, '$.processIncarnation'), " +
|
||||
"'sessionId', json_extract(content, '$.sessionId'), " +
|
||||
"'transcriptPath', json_extract(content, '$.transcriptPath'), " +
|
||||
"'wslDistro', json_extract(content, '$.wslDistro'), " +
|
||||
"'fallbackReason', json_extract(content, '$.fallbackReason'))) " +
|
||||
"ELSE '{\\"version\\":3}' END WHERE dispatch_id = ? AND " + workerData.copyPredicate
|
||||
);
|
||||
|
||||
@@ -35,12 +35,16 @@ export async function readRemoteAttachmentArchive(args: {
|
||||
})
|
||||
}
|
||||
|
||||
/** Release receipts carry the output only while its original is still readable. */
|
||||
/** Release receipts carry the output only while its original is still readable and steady. */
|
||||
export function readRemoteAttachmentOutputIfAvailable(
|
||||
args: Parameters<typeof readRemoteAttachmentArchive>[0]
|
||||
): ReturnType<typeof readRemoteAttachmentArchive> {
|
||||
return readRemoteAttachmentArchive(args).catch((error: unknown) => {
|
||||
if (error instanceof OrchestrationError && error.code === 'archive_unavailable') {
|
||||
// A transcript written during the read only drops the optional page; it never blocks release.
|
||||
if (
|
||||
error instanceof OrchestrationError &&
|
||||
(error.code === 'archive_unavailable' || error.code === 'source_changed')
|
||||
) {
|
||||
return null
|
||||
}
|
||||
throw error
|
||||
|
||||
Reference in New Issue
Block a user