Created
Jul 01, 14:49
Started
Jul 01, 14:51
DevOps handoff
Type
Feature
Shape
backend
Worktree Slug
capture-action-tokens-and-cost
Repositories
mcritchie-studio
Release Slug
—
Branch
feat/capture-action-tokens-and-cost
Pull Request
—
Acceptance Criteria
Expected Test Plan
Checks Run
No completed checks recorded.
Agent Context
The PostToolUse hook (bin/atomic-capture-hook) already reads message.model from the transcript tail but never message.usage, and the capture endpoint doesnt permit tokens/cost, so AtomicAction rows land with tokens_in/out=0, cost=0 -> heartbeat span roll-up shows blank tokens/cost while model populates. Fix: hook also reads message.usage (+ message.id as usage_ref) from the same assistant line and sends tokens_in/tokens_out; controller permits tokens_in/tokens_out/cost/usage_ref; AtomicAction.capture dedupes by usage_ref so one assistant turn (which can fan out parallel tool calls) is counted ONCE (first action of the turn keeps usage, siblings zeroed) -> no double counting. Cost derived server-side from model price table. No view change: _event_table already rolls up totals.
Stage Timeline
Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. — means the agent didn't report that metric.
Conversation
QA review feedback, agent handoffs, and follow-up notes for this task.
No task feedback has been recorded yet.
Sealed-bid sizing
Edit →Alex (PM)
—
Avi (PO)
MEDIUM
Dev
MEDIUM
Actual
—
We emailed a one-tap sign-in link to . It expires shortly and can only be used once.
No email? Check spam, or close this and try again.