Skip to content

tui: show the cost estimate in the mini/run footer #60653

Open

Description

@augustovicente

Follow-up to #59864 (which closes #59861). The experimental["cost-estimate"] experiment currently covers the main TUI sidebar and prompt footer only. In mini/run mode a provider that reports $0 still shows no spend at all.

Current behavior

packages/tui/src/mini/footer.view.tsx renders spend from props.state().usage.cost, which is populated per step from session.step.ended in stream-v2.transport.ts (event.data.cost || undefined). A reported zero is therefore indistinguishable from "cost not reported" and the line disappears.

What it needs

  • Expose the experiment to mini: RunTuiConfig in mini/types.ts picks a fixed set of config fields and does not include experimental.
  • Session-level totals: state.usage is per-step, not accumulated. The estimate needs the session's tokens/model (an SDK session.get, which the runtime already performs for resume and subagent discovery).
  • Tiered models: per-call tier surcharges need the loaded assistant steps, like costEstimate in packages/tui/src/util/session.ts does for the main footer.
  • Decide scope: the current session only, or the root family like the main TUI. The family needs listing children; the main TUI gets that for free from the client store.

Acceptance criteria

  • With experimental["cost-estimate"] = true and a provider reporting cost: 0, the mini footer shows ≈ $X from catalog prices.
  • Positive reported costs keep precedence.
  • Sub-cent spend renders as ≈ <$0.01.
  • Sessions without catalog pricing omit the estimate instead of under-reporting.
  • No change when the experiment is off.

Activity

  1. opencodejr commented on Oct 30, 2026

    @opencodejr
    Contributor

    Thanks for the detailed follow-up! You're asking for the opt-in experimental["cost-estimate"] catalog-price estimate to work in the mini/run footer too, so that providers reporting $0 still show ≈ $X there, the same as the main TUI sidebar and prompt footer.

    This depends on #59864, which adds the experiment and hasn't been merged yet. The maintainers will consider it, including your open question of whether to show only the current session or the whole root session family.

    Related issues:

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