| 1 | package agent |
| 2 | |
| 3 | import "reasonix/internal/provider" |
| 4 | |
| 5 | // applyLatestContextShape copies the latest single-request shape into Context* |
| 6 | // fields for gauges and Desktop rebind telemetry. |
| 7 | func applyLatestContextShape(dst, latest *provider.Usage) { |
| 8 | if dst == nil || latest == nil { |
| 9 | return |
| 10 | } |
| 11 | dst.ContextPromptTokens = latest.PromptTokens |
| 12 | dst.ContextCompletionTokens = latest.CompletionTokens |
| 13 | dst.ContextReasoningTokens = latest.ReasoningTokens |
| 14 | dst.ContextCacheHitTokens = latest.CacheHitTokens |
| 15 | dst.ContextCacheMissTokens = latest.CacheMissTokens |
| 16 | } |
| 17 |