feat(coding-agent): expose post-compaction token estimates

closes #5877
This commit is contained in:
Armin Ronacher
2026-06-18 23:01:10 +02:00
parent b09fbde00e
commit c60f6a8ab3
5 changed files with 28 additions and 1 deletions

View File

@@ -374,11 +374,14 @@ Response:
"summary": "Summary of conversation...",
"firstKeptEntryId": "abc123",
"tokensBefore": 150000,
"estimatedTokensAfter": 32000,
"details": {}
}
}
```
`estimatedTokensAfter` is a heuristic estimate over the rebuilt message context immediately after compaction, not a provider-exact token count.
#### set_auto_compaction
Enable or disable automatic compaction when context is nearly full.
@@ -924,6 +927,7 @@ The `reason` field is `"manual"`, `"threshold"`, or `"overflow"`.
"summary": "Summary of conversation...",
"firstKeptEntryId": "abc123",
"tokensBefore": 150000,
"estimatedTokensAfter": 32000,
"details": {}
},
"aborted": false,