Commit a21aa5e
authored
🤖 fix: omit providerMetadata from compaction summary to fix context display (coder#762)
After compaction, context usage was inflated because the summary
message's `providerMetadata` contained `cacheCreationInputTokens` from
the pre-compaction context.
This fix omits `providerMetadata` from the compaction summary message.
Context usage now correctly shows just the compaction output tokens
until the next API request.
Cost tracking remains accurate via the `historicalUsage` field.
_Generated with `mux`_1 parent 06f3b80 commit a21aa5e
File tree
2 files changed
+7
-4
lines changed- src/node/services
2 files changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
273 | | - | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
126 | | - | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
0 commit comments