coleam00/Archon · warning

persist_session_upsert_failed

persist_session_upsert_failed

Error message

⚠️ Could not persist the session for node `${node.id}` (${provider}). The next run will start this node fresh.

What it means

Non-fatal warning: writing the node's session to the persistence store (upsert) threw after the node already ran successfully. The execution result stands, but the next run will start this node fresh because nothing was persisted.

Source

Thrown at packages/workflows/src/dag-executor.ts:10689

                    last_run_id: ctx.workflowRun.id,
                  });
                } else {
                  // Provider returned no session ID (e.g. Codex with no thread ID).
                  // Drop the stale row for THIS provider only — leave other providers'
                  // rows intact so switching providers between runs doesn't clobber
                  // the other side's continuity.
                  await ctx.deps.store.deleteWorkflowNodeSessions({
                    workflow_name: ctx.workflowName,
                    scope_key: ctx.persistScopeKey,
                    node_id: node.id,
                    provider,
                  });
                }
              } catch (err) {
                // Non-fatal: persistence failure does not undo a successful node execution.
                // But the user opted into persistence — the next run will start fresh for
                // this node, so warn them as well as the logs.
                getLog().warn(
                  {
                    err: err as Error,
                    nodeId: node.id,
                    workflow: ctx.workflowName,
                    scopeKey: ctx.persistScopeKey,
                    provider,
                  },
                  'persist_session_upsert_failed'
                );
                await safeSendMessage(
                  ctx.platform,
                  ctx.conversationId,
                  `⚠️ Could not persist the session for node \`${node.id}\` (${provider}). The next run will start this node fresh.`,
                  { workflowId: ctx.workflowRun.id, nodeName: node.id }
                );
              }
            }

View on GitHub (pinned to 0773b97458)

Solutions

  1. Check server logs for the underlying `err` on this event
  2. Verify database health and available disk space
  3. Re-run the workflow (or the node) so the session is persisted again
  4. If it recurs, inspect the sessions table constraints and adapter version
Defensive patterns

Strategy: retry

Validate before calling

// Confirm the session store accepts writes before the run
await store.upsertTestRow();

Try / catch

try {
  await runNode(node);
} catch (err) {
  if (isPersistUpsertFailed(err)) {
    await retry(() => persistSession(node), { retries: 3, backoff: 'exponential' });
  } else throw err;
}

Prevention

When it happens

Trigger: Catch branch around the session upsert for (workflow, node, persistScopeKey, provider); DB write failures, constraint violations, storage full, connection drops.

Common situations: Database briefly unavailable at node completion; schema/adapter mismatch after upgrade; disk pressure on the SQLite/Postgres host.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/3ba63a8d98752a5a. Report an issue: GitHub.