Created
Jul 01, 16:52
Started
Jul 01, 16:53
Completed
Jul 01, 17:26
DevOps handoff
Type
Feature
Shape
ui-only
Worktree Slug
fade-shared-turn-token-duplicates
Repositories
mcritchie-studio
Release Slug
—
Branch
feat/fade-shared-turn-token-duplicates
Acceptance Criteria
Expected Test Plan
Checks Run
Agent Context
UI-only polish on the heartbeat per-action rows (/alex/heartbeat drill-down under spans + the Unlabeled group). CONTEXT: token/cost usage is metered PER ASSISTANT TURN, not per tool-call, so N tool-calls from one turn each carry that turn's usage and render IDENTICAL tokens/cost (they share source_turn_uuid). This reads like duplication. FIX: within a session, the FIRST action (chronological, by occurred_at then seq) of each source_turn_uuid is the PRIMARY and shows tokens+cost in normal color; every subsequent action sharing that source_turn_uuid renders its TOKENS and COST cells in a FADED/muted text color (e.g. a text-muted or opacity-60 class) so it is visually clear they INHERIT the turn's spend rather than adding new spend. Actions with a blank/nil source_turn_uuid are each their own primary (never faded). ONLY the tokens and cost cells change color — kind, model, pokemon, narration, status all stay normal. Compute primary-vs-duplicate in the controller or a helper by walking the session's actions in chronological order and tracking which source_turn_uuid values have been seen (exactly ONE primary per turn across the whole session, even if a turn's calls land under different spans); pass a boolean like turn_shared/is_dup to the per-action row partial. Add a subtle title/tooltip on the faded cells such as 'shared with this turn's first action'. DO NOT change any token/cost VALUES, the cost math, or heartbeat_usage_totals (span/session totals stay deduped + unchanged) — this is purely text-color on repeated rows. Files: app/controllers/heartbeat_controller.rb (or app/helpers/heartbeat_helper.rb) to flag duplicates; the per-action row partial that renders TOKENS/COST (app/views/heartbeat/_trajectory_table.html.erb and/or the event drill-down rows) + CSS in show.html.erb. Mind Nokogiri/Alpine test gotchas (assert server-rendered classes, not Alpine-hidden DOM); fresh worktree run bin/rails tailwindcss:build before layout tests. Tests: component/integration asserting the 2nd+ action of a shared turn gets the faded class on tokens/cost while the first does not, and a solo-turn action is not faded. Part of narrated-events epic — project_opsd_learning_layer.
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)
SMALL
Dev
SMALL
Actual
LARGE
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.