Skip to content

Custom menu-bar cost tokens stay stale after token-cost refresh #2300

Description

@vincent-peng

Summary

Cost Today and 30d Cost in a custom menu-bar layout render from token-cost snapshots. Publishing a new token snapshot invalidates menus, but does not enter the menu-bar icon/title refresh path. The displayed cost can therefore remain or stale until an unrelated usage or settings change occurs.

Source path

  • StatusItemController+MenuBarLayout reads the current provider token snapshot to render Cost Today and 30d Cost.
  • UsageStore.menuObservationToken observes token snapshots and causes menu invalidation.
  • UsageStore.iconObservationToken and the corresponding icon-observation signature do not include token snapshots or their cost values, so they do not request a title refresh for a cost-only update.

Reproduction

  1. Save a custom menu-bar layout containing Cost Today or 30d Cost.
  2. Keep the provider usage snapshot unchanged.
  3. Publish or refresh a token-cost snapshot.

Expected behavior

The rendered menu-bar title should update when the cost value used by the active layout changes.

Suggested acceptance criteria

  • Add focused coverage that publishes a token-cost snapshot while the usage snapshot is unchanged and asserts that the rendered title/invalidation changes.
  • Include only render-relevant token-cost state in menu-bar refresh observation, avoiding broad invalidation for unrelated token data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions