Skip to content

Aggressive session fork price conflation #306

Description

@rasmniel

Pre-flight checks

  • I searched existing issues and did not find a duplicate.
  • I verified this on the current production released OpenCode version, or I explain why not below.

Which OpenCode do you use?

OpenCode 1 (opencode-quota 4.x)

OpenCode version tested

1.18.34

opencode-quota version tested

4.10.1

Bug summary

Token totals (token_total, token_daily, token_weekly, etc.) sum all forks into the total, which is clearly incorrect in terms of actual consumption.

Steps to reproduce

  1. Create a session and start the conversation to incur consumption costs.
  2. Fork the session, but do not continue the conversation to incur further consumption costs.
  3. Check the totals, which will now sum both the main session and the fork, providing an inflated total cost.

Expected behavior

Forked session responses should be filtered if they are part of another session.

Actual behavior

The tokens are summed for every fork of a session. Concrete example:
A session has a cost of $10, and my total is correctly reported as $10.
I fork the session but do not use it further, yet my totals are now incorrectly reported as $20.

Relevant logs/output

If not tested on current production OpenCode, explain why

No response

Activity

  1. added
    v4OpenCode 1 user (opencode-quota 4.x line, small fixes only)
    on Oct 2, 2026
  2. slkiser commented on Oct 3, 2026

    @slkiser
    Owner

    Fixed: forked sessions' copied messages now count once in token and cost totals, shipping in v4.10.8 (OpenCode 1, #313) and v5.0.2 (OpenCode 2, #312).

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

    bugSomething isn't workingv4OpenCode 1 user (opencode-quota 4.x line, small fixes only)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions