Token usage stops at LiteLLM: agent-proxy records 0 and the harness records nothing #135
Labels
No labels
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/agent-proxy#135
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Filed by Olaf (ops seat) from the Owl Deep critical-failure investigation on 2026-08-18. Kai approved fixing this. Read-only observation, no configuration opened.
Sibling of
coilyco-gaming/sirens-echo#932, which had to measure its cache-read finding off LiteLLM spans for exactly the reason below.What is measured
SigNoz on ser8, 3h window ending 2026-08-18 ~01:10Z,
sum(gen_ai.usage.input_tokens)grouped byservice.name:litellm- 3,905,072agent-proxy- 0sirens-deep-owl-glass- null, the attribute is absent rather than zeroThe trajectory ledger agrees. All 92
model.response.capturedevents in a 6h window carryagentproxy.prompt_tokens: 0andagentproxy.completion_tokens: 0. Sample:request_id 1539073268550737965,logical_model sirens-echo/deepseek,upstream_mode litellm,outcome ok,finish_reason stop. Not a sampling artifact, and not confined to failures.So the number exists at the bottom hop, is zeroed at the middle hop, and never reaches the top hop.
Why it matters
model.requestgrew from 132,111 bytes at round 0 to 217,079 bytes at round 5 onsirens-deep-owl-glass. No component in the path could express that in tokens, so no budget, alarm, or admission check could act on it. Bytes are the only unit anyone upstream has.Same shape as
coilyco-gaming/sirens-echo#675: the information is present one hop down and structured, and it does not propagate up. #675 tracks the error instance of that pattern. This is the usage instance.Ask
agent-proxy copies upstream usage onto its own spans and into
model.response.captured: prompt, completion and total tokens, pluscache_read_input_tokenswhere the upstream reports it.Done when
sum(gen_ai.usage.input_tokens)onagent-proxyspans is non-zero and tracks LiteLLM's for the same window, and amodel.response.capturedevent for a successful chat carries non-zero prompt and completion tokens.Not established, stated rather than papered over
sirens-echo/deepseek. I measured the aggregate across the window, not per route.The middle hop is fixed. The top hop is not, and it is not this repository's.
Same three-hop measurement as this issue, SigNoz, 3h window ending 2026-08-19 ~07:00Z:
The agent-proxy zero is closed by
50af3deandf4a59d3, both onmainand both deployed: streaming was never asking the provider for the usage block, and once it did, the normalizer read usage only in thefinish_reasonbranch while the usage arrives in a chunk of its own after it. #138 and #139 carried those halves and are now closed with the verification.What remains is the harness hop, where
gen_ai.usage.input_tokensis still absent rather than zero. That iscoilyco-gaming/sirens-echoreading what agent-proxy now reports and not recording it, so the remaining work does not live here.Two things worth knowing before anyone picks that up:
model.response.capturedevents carryingagentproxy.prompt_tokens: 0- was downstream of the agent-proxy zero. Those should now carry real numbers, and re-measuring is the cheap first step rather than assuming they still do not.Leaving this open for the harness half, and worth retitling to say so, since the title as written now describes a state that is two thirds repaired.