@sema-agent/core
Version:
Stateless, task-oriented AI agent core
20 lines (19 loc) • 1.05 kB
JavaScript
import { EXECUTION_RECORD_LEAVES_ROW_UNRECORDED } from "../checkpoint-execution-record.js";
import { deliverEngineNotice } from "../types.js";
export function settleExecutionRecord(onNotice, word, facts) {
if (!EXECUTION_RECORD_LEAVES_ROW_UNRECORDED[word])
return;
deliverEngineNotice(onNotice, {
code: "checkpoint.execution_outcome_unrecorded",
message: `The resolved tool call "${facts.toolName}" was disposed (${facts.gate.disposition.kind}) but its execution record could not be filed on the checkpoint: ` +
`the store answered "${word}" — the row is no longer a resolved row of this scope (reopened, expired or removed under this leg). ` +
`The execution result stands as delivered; the row reads unknown on its execution axis.`,
detail: {
sessionId: facts.sessionId,
runId: facts.runId,
scope: facts.scope,
...(facts.checkpointId !== undefined ? { checkpointId: facts.checkpointId } : {}),
word,
},
});
}