Skip to content

[FEATURE]: Show total cost including subagents in the session footer #39740

Closed

Description

@efirvida

Description

The opencode footer currently shows context usage and estimated session cost, but this only reflects the main agent. When an agent invokes subagents (via the Task tool), each subagent runs its own session with its own token consumption and cost — and that spend is not added to the visible total.

Current behavior

  • The footer (bottom bar) shows tokens used and cost only for the active main agent.
  • Subagents spawn separate child sessions that also consume tokens and have associated costs.
  • There is no way in the UI to see the real total cost of the session (main agent + all subagents).

Expected behavior

The footer should show:

  • The cumulative total cost: main agent + all invoked subagents.
  • Alternatively, at least an indication that the displayed cost is agent-only, with access to per-subagent breakdown.

Benefits

  • Real transparency on the full session cost.
  • Avoids surprises when checking the provider billing.
  • Helps users decide whether to use more or fewer subagents based on their cost impact.

Additional context

This is especially relevant for workflows that heavily use subagents — such as the SDD workflow (sdd-apply, sdd-verify, review-*, etc.) — where a significant portion of the work happens in subagents.

Activity

  1. changed the title [-][FEATURE]: Mostrar el costo total incluyendo subagentes en el footer[/-] [+][FEATURE]: Show total cost including subagents in the session footer[/+] on Jul 30, 2026
  2. igorvelho commented on Aug 21, 2026

    @igorvelho

    While that's making its way through review, if anyone wants this sooner: opencode-session-cost is a small TUI plugin that adds a sidebar block showing session cost plus all subagent costs, with a breakdown per subagent. It works out of the box using OpenCode's own session data, no core changes needed.

  3. neriousy commented on Oct 19, 2026

    @neriousy
    Member

    This is implemented in v2: the main session’s cost in the terminal footer and sidebar includes its subagent sessions, rather than only the main agent’s spend. To get v2, run npm i -g @opencode/cli@latest. If you still see this on v2, please open a new issue with the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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