Commit c1a6bc6
refactor: extract clonePersistedToolModelUsage helper in streamManager
The deep-clone pattern for PersistedToolModelUsage (spread event, fresh
usage object, conditional providerMetadata) was duplicated in
recordToolModelUsage and the stream-end tool-usage snapshot. Extract a
single file-local helper so both sites share the same implementation.
Behavior-preserving: both callsites continue to produce structurally
identical clones (usage is always shallow-copied; providerMetadata is
included only when non-nullish).1 parent eb18b4e commit c1a6bc6
1 file changed
Lines changed: 15 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
326 | 339 | | |
327 | 340 | | |
328 | 341 | | |
| |||
473 | 486 | | |
474 | 487 | | |
475 | 488 | | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
| 489 | + | |
481 | 490 | | |
482 | 491 | | |
483 | 492 | | |
| |||
2197 | 2206 | | |
2198 | 2207 | | |
2199 | 2208 | | |
2200 | | - | |
2201 | | - | |
2202 | | - | |
2203 | | - | |
2204 | | - | |
2205 | | - | |
2206 | | - | |
| 2209 | + | |
2207 | 2210 | | |
2208 | 2211 | | |
2209 | 2212 | | |
| |||
0 commit comments