Skip to content

feat: Session cost display and budget warning notifications #20

Description

@rdwj

Summary

Show users their token consumption and estimated cost for the current session. Display warnings when approaching budget limits so users can make informed decisions about continued interaction.

UX Requirements

  • Token usage display in session header or sidebar (input tokens, output tokens, estimated cost)
  • Budget progress bar when budget limits are configured
  • Warning notification (toast or banner) when approaching soft budget limit (e.g., 80%)
  • Error/blocking notification when hard budget limit is reached
  • Per-message token count available on hover or in message metadata popover
  • Cost breakdown by model if multiple models are used in the session
  • Usage data refreshes after each assistant response, not on a polling interval
  • Dismissible warnings — don't nag after acknowledgment

Implementation Notes

Read usage data from GET /v1/sessions/{id}/usage via the gateway. Budget information can also arrive in response headers (X-Token-Usage, X-Budget-Remaining) on each chat completion response. The UI should cache the latest usage snapshot and update incrementally. Budget thresholds are configured server-side; the UI only renders them.

Companion Issues

Companion issues filed on fips-agents/agent-template, fips-agents/gateway-template, fips-agents/fips-agents-cli, and fips-agents/examples.

Size

S-M

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions