MCPcopy Create free account
hub / github.com/apache/maka / enqueueTraceWriteFailure

Method enqueueTraceWriteFailure

packages/runtime/src/agent-run.ts:1771–1798  ·  view source on GitHub ↗
(
    error: unknown,
    label = 'agent run store write',
  )

Source from the content-addressed store, hash-verified

1769 }
1770
1771 private async enqueueTraceWriteFailure(
1772 error: unknown,
1773 label = 'agent run store write',
1774 ): Promise<void> {
1775 const message = errorMessage(error);
1776 this.traceWriteError ??= `${label}: ${message}`;
1777 try {
1778 await this.input.runStore?.updateRun(this.sessionId, this.runId, {
1779 traceWriteError: this.traceWriteError,
1780 updatedAt: this.input.now(),
1781 });
1782 } catch {
1783 // The terminal header commit retries the in-memory latch.
1784 }
1785 try {
1786 await this.input.runStore?.appendEvent(this.sessionId, this.runId, {
1787 type: 'trace_write_failed',
1788 id: this.input.newId(),
1789 runId: this.runId,
1790 sessionId: this.sessionId,
1791 turnId: this.turnId,
1792 ts: this.input.now(),
1793 message,
1794 });
1795 } catch {
1796 // Diagnostic persistence is best effort; never perturb model/tool execution.
1797 }
1798 }
1799}
1800
1801function runtimePartialCoalescingKey(event: RuntimeEvent): string | undefined {

Callers 8

updateSessionStatusMethod · 0.95
recordSessionEventMethod · 0.95
createRunRecordMethod · 0.95
commitTerminalRunMethod · 0.95
enqueueRunStoreMethod · 0.95

Calls 5

errorMessageFunction · 0.70
updateRunMethod · 0.65
nowMethod · 0.65
appendEventMethod · 0.65
newIdMethod · 0.65

Tested by

no test coverage detected