GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Input tokens inconsistent with circle context · Issue #34712 · anomalyco/opencode

Input tokens inconsistent with circle context #34712

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Input tokens inconsistent with circle context#34712
Copy link
Assignees
nexxeln

Description

@promptcombos
promptcombos
opened on Jul 1, 2026
Issue body actions

Description

Image

At version 1.17.12, count input token was wrong. Input tokens was increase wrong. I also try to compact but Input token still do not decrease while Usage show less.

Plugins

NA

OpenCode version

1.17.12

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Reacted by Kirill Lebedinov, Pyae Sone Maung, Jardel, Ray and royruho

Activity

  1. github-actions
    assigned
    nexxeln
    on Jul 1, 2026
  2. github-actions commented on Jul 1, 2026

    @github-actions
    github-actionsBot
    on Jul 1, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [BUG] /compact command does not compress - context increases instead #17557: /compact command does not compress - context increases instead — similar symptom of compact not reducing token count
    • Multi-step tool calls overwrite token counts instead of accumulating (output, reasoning, cache.write lost) #21913: Multi-step tool calls overwrite token counts instead of accumulating — related incorrect token counting behavior
    • Session token usage grows unbounded via cache.read and causes unrecoverable context-window errors #30649: Session token usage grows unbounded via cache.read — token count growing unexpectedly
  3. wickedits commented on Jul 8, 2026

    @wickedits
    wickedits
    on Jul 8, 2026
    More actions

    Weird that nobody has addressed this critical visual bug already

  4. royruho commented on Jul 8, 2026

    @royruho
    royruho
    on Jul 8, 2026
    More actions

    This is a very critical issue I also experience.
    at least for v 1.17.12 - v.1.17.14
    The token count is inflated - /compact does not reduce it and worst of all
    this means that we can't track context size, therefore when to /compact the session

    Issue exist both for web and desktop

    TUI works fine

  5. yochaym22 commented on Jul 8, 2026

    @yochaym22
    yochaym22
    on Jul 8, 2026
    More actions

    Seeing the same thing.

    Environment
    OpenCode version: 1.17.14 (also reproduced on 1.17.12 per the original report)
    Last known good: 1.17.11 — the inflated count does not occur there
    Interface: Desktop / Web (TUI is unaffected — see below)
    OS: [your OS + version]
    Provider/model: [e.g. Anthropic / Claude Sonnet 4.5]

    Summary
    The input/context token count is inflated in Web/Desktop and /compact does not bring it down, even though the Usage view reports a smaller number. The TUI, in the same session, shows the correct (much lower) count.
    Steps to reproduce

    Start a session and run enough turns to accumulate history (tool calls / file reads help).
    Compare the token count shown in the TUI vs. Web/Desktop for the same session — Web/Desktop is several times higher.
    Run /compact. The TUI count drops as expected; the Web/Desktop input-token figure stays high and can keep climbing.

    TUI vs Web/Desktop
    This looks like the long-standing display discrepancy from #3322: the TUI reports the current context (last message), while Web/Desktop aggregates across the whole session, so its number is cumulative rather than the actual prompt size.
    Likely root cause
    I think this is the accumulation bug described in #30649: session token fields (including tokens_cache_read) are summed additively every turn in projector.ts, so the session total is a lifetime counter, not the current context. That explains why /compact can't reduce it — pruning messages doesn't decrement a cumulative counter — and why it keeps increasing. When overflow/compaction logic reads that inflated cumulative value, sessions also hit context_length_exceeded errors even when the true context would fit (related: #17746, #29857).
    Regression window
    Clean on 1.17.11, present on 1.17.12 and 1.17.14.

  6. github-actions commented on Sep 7, 2026

    @github-actions
    github-actionsBot
    on Sep 7, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  7. github-actions
    closed this as not plannedon Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @nexxeln
    nexxeln

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.