(
error: unknown,
label = 'agent run store write',
)
| 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 | |
| 1801 | function runtimePartialCoalescingKey(event: RuntimeEvent): string | undefined { |
no test coverage detected