* Saves the current session's scroll position in-memory for this tab.
()
| 1007 | sessionId: session.id, |
| 1008 | requestId: message.id, |
| 1009 | usage: { ...usage, model: usage?.model || message.model }, |
| 1010 | kind |
| 1011 | }); |
| 1012 | if (metadata) Object.assign(message, metadata); |
| 1013 | } |
| 1014 | |
| 1015 | async tryRecordRuntimeUsage(data) { |
| 1016 | try { return await this.runtime.recordUsage?.(data); } |
| 1017 | catch (error) { |
| 1018 | // Accounting is an estimate. A storage failure must never replace |
| 1019 | // a successful response or turn cancellation into a stream error. |
| 1020 | console.warn('Could not save the local usage estimate:', error?.message || 'Storage unavailable'); |
| 1021 | return null; |
| 1022 | } |
| 1023 | } |
| 1024 |
no test coverage detected