trace close discards the tool-call count, which is the actual cost multiplier #199
Labels
No labels
already-shipped
bug
documentation
duplicate
enhancement
external-review
good first issue
help wanted
in progress
invalid
needs-decision
proposal
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: crenshawdev/cadence-archived#199
Loading…
Add table
Add a link
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?
The defect
The subagent return carries a tool-call count and Cadence throws it away.
Today's returns, verbatim: the phase-2 executor came back with
<subagent_tokens>160988</subagent_tokens><tool_uses>86</tool_uses>, the deepverifier with
55251/24.trace closetakes--tokensand has nowhere toput the other number, so the record keeps the term that under-reports by ~20x
and discards the term that is the actual cost multiplier.
Why turns are the multiplier
Decomposed over the last 7 days on this repo, the bill is
cost ~= turns x window x 0.10:15,579 messages at an average 121,250-token window. Every assistant turn re-reads
the whole window at the cache-read rate, so a dispatch's cost is close to linear
in its turn count. At 121,250 the phase-2 executor's 86 turns are roughly
1.04M billed-equivalent in re-reads alone, before anything it wrote.
Cache HIT RATE is not the lever - it is already 96.1% and cache-read is the cheap
rate. Turn count is, and it is the one quantity the record never captures.
The fix
Add a tool-call (or turn) field to the close seam:
Same shape as
--tokens: omitted when the return carries no figure, neverdefaulted to 0. Every dispatch site in
workflows/already reads the return toget
--tokens, so the count is in hand at exactly the same moment and no sitegains a read.
Then
trace renderandtrace suggestcan report turns per dispatch andturns per role beside the token totals, which is the first time the multiplier
becomes visible at all.
Why this one first
It is a one-field change and it is the prerequisite for judging every other cost
proposal: whether batching improved, whether bigger plans amortize better,
whether a window budget is being approached. None of those can be argued today
because the number does not exist.