Skip to content

feat(usage): account for dream and consolidation planner token usage #1791

Open

Description

@jbeda

Goal

Track token usage for dream and memory-consolidation planning without fabricating a Session.tokenUsage attribution when no source chat session exists.

This work is intentionally deferred from #1216, which covers session-associated auxiliary LLM calls only.

Scope

  • Inventory dream and consolidation planner invocations, including scheduled/background and manual-review paths.
  • Decide the correct durable accounting owner and lifecycle for usage that is not associated with a chat session.
  • Preserve provider/model-level attribution for the model that actually served each request.
  • Define best-effort behavior for partial streams, retries, and crash uncertainty.
  • Do not add monetary pricing, currency conversion, or billing reconciliation.

Non-goals

  • Changing Session.Usage, EvResult.Usage, or MaxRunTokens.
  • Retroactively reconciling historical requests.
  • Folding non-session spend into an arbitrary session.

Tracking: #1216

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions