fix(headroom): clarify token diagnostics vs provider billing
Distinguish Headroom-reported token deltas from outbound payload size, scrub credentials in logs, and warn on phantom savings when compressed JSON barely shrinks. Refs #1998 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
parent
c7933de79c
commit
fb543a1f39
@@ -66,8 +66,8 @@ describe("compressWithHeadroom", () => {
|
||||
});
|
||||
|
||||
describe("formatHeadroomLog", () => {
|
||||
it("formats savings", () => {
|
||||
it("formats reported token deltas without implying provider billing savings", () => {
|
||||
expect(formatHeadroomLog({ tokens_before: 100, tokens_after: 25, tokens_saved: 75 }))
|
||||
.toBe("saved 75 tokens / 100 (75.0%) after=25");
|
||||
.toBe("reported token delta=75 before=100 after=25 (75.0%)");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user