Skip to content

Investigate partial and per-model Claude usage accounting #1945

Closed

Description

@currentbits

Audit Claude usage when steering/interruption ends a query without its final result, and when advisor/subagent/compaction work uses a different model.

Current source records usage primarily from result frames. A process-level modelUsage delta helper already exists, but its split-row path is gated on a recorded in-process model switch. That is evidence for targeted fixtures, not proof that every advisor path undercounts. Keep current warm-process cumulative cost handling, which already subtracts previous reported totals.

Acceptance criteria:

  • Reproduce steering stream exit without final result, ordinary interruption and successful multi-segment completion using captured/synthetic frames.
  • Retain known input/output/cache/reasoning measurements and mark partial/unavailable fields explicitly; avoid zeroing known earlier values.
  • Check advisor message.usage.iterations and process modelUsage for exact per-model attribution, deduplication and double-count avoidance.
  • Keep root versus background/child work and original observed model identity explicit. Do not assign unconfirmed model names or reconstruct unsupported history.
  • Keep provider-reported cost authoritative; distinguish live ledger accounting from optional transcript import.
  • Report concrete failing/passing cases before deciding implementation scope.

Coordinate with #1928 for stored per-model buckets, #1927 for historical model identity, #1870 for context metadata and #1904 for quota recovery. Tracked by #1926. No paid provider runs or real credential access required for initial verification.

Activity

  1. added
    plan:todo
    plan:doing
    and removed
    plan:todo
    on Nov 8, 2026
  2. added
    plan:done
    and removed
    plan:doing
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions