Skip to content

session-cost/spent-value under reported for sessions with 100+ messages #7767

@IdrisGit

Description

@IdrisGit

Description

The TUI sidebar displays incorrect spent value for sessions that exceed 100 messages. The cost only accumulates from the last 100 messages stored in memory, not from all messages that exist in the session.

Plugins

No response

OpenCode version

1.1.12

Steps to reproduce

  1. Start a new session with a paid model.
  2. Continue conversation until you have > 100 messages (requires iterative work over several hours/days).
  3. Check the spent value displayed in the sidebar.
  4. Compare with actual cost (using Zen dashboard).

Expected: Sidebar shows accurate total cost from all messages including messages that were reverted.
Actual: Sidebar shows cost only from the last ~100 messages.

Screenshot and/or share link

No response

Operating System

Arch Linux (Omarchy)

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingzenRelates to Zen

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions