@sagentlab/navarch-runtime 0.1.165 → 0.1.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -306,10 +306,14 @@ async function runConversationTurn(deps, conversationId, turnId) {
|
|
|
306
306
|
if (!run.lost)
|
|
307
307
|
log.warn(`conversation ${conversationId} turn ${turnId} could not start: ${String(error).slice(0, 300)}`);
|
|
308
308
|
}
|
|
309
|
-
if (prepared && !run.lost) {
|
|
309
|
+
if (prepared && !run.lost && !controller.signal.aborted) {
|
|
310
310
|
// After this write a crash can never lead to a second launch of this turn id.
|
|
311
311
|
journal.state = "started";
|
|
312
312
|
await deps.journal.write(journal);
|
|
313
|
+
}
|
|
314
|
+
// Lease loss, stop or shutdown can occur while the durable write is pending.
|
|
315
|
+
// Recheck authority immediately before calling the adapter.
|
|
316
|
+
if (prepared && !run.lost && !controller.signal.aborted) {
|
|
313
317
|
run.launchedAt = node_perf_hooks_1.performance.now();
|
|
314
318
|
const result = await deps.adapter.conversation.run({
|
|
315
319
|
prompt, bin: deps.bin, ...(deps.model ? { model: deps.model } : {}),
|
package/package.json
CHANGED