Skip to content

Bug : context window is not true #84

Closed

Description

@jcastillooo

Type: Bug

it sas context window is at 100%, even though its a fresh session.

Extension version: 2.2.1
VS Code version: Code 1.122.1 (8761a5560cfd65fdd19ce7e2bd18dab5c0a4d84e, 2026-05-29T09:25:37+02:00)
OS version: Windows_NT x64 10.0.26200
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x1d10 [NVIDIA GeForce MX150], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=25.21.14.1735 ACTIVE
GPU1: VENDOR= 0x8086, DEVICE=0x3ea0 [Intel(R) UHD Graphics 620], DRIVER_VERSION=25.20.100.6617
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8875
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.90GB (3.93GB free)
Process Argv
Screen Reader no
VM 0%

Activity

  1. github-actions commented on Jul 30, 2026

    @github-actions

    🤖 Automated first-pass reply

    TL;DR

    The context window indicator likely misreports because getCurrentContextInfo or contextWindowFor in src/dataLoader.ts returns contextTokens equal to or greater than windowTokens for a fresh session. I need to see the full implementation of these two methods (the provided dataLoader.ts excerpt is truncated before they appear) to diagnose why contextTokens / windowTokens is always ≥ 1.

    Analysis

    The percentage is computed in src/statusBar.ts:

    const pct = Math.min(100, (info.contextTokens / info.windowTokens) * 100);

    If every session—including a fresh, empty one—shows 100%, the likely causes in order of probability:

    1. contextTokens defaults to windowTokens or a number that equals/exceeds the window size when no real data is available (e.g. a session file exists but has no usage line yet).
    2. windowTokens is 0 or negative, and the if (info.windowTokens <= 0) → hide guard in statusBar.ts is either not hiding early enough (takes the Math.min(100, …) path) or the value is 1, making 1/1 = 100%.
    3. getCurrentContextInfo infers context from the last log line, which for a fresh session might carry a stale or seeded context-token value that happens to match the model's window.

    Suggested next step(s)

    Please provide:

    • The full getCurrentContextInfo and contextWindowFor implementations from src/dataLoader.ts.
    • Any currentSessionId / session detection logic upstream that feeds these methods.

    TL;DR(中文)

    上下文窗口指示器可能一直显示 100%,是因为 getCurrentContextInfo 或 contextWindowFor 在新会话中返回的 contextTokens 等于或大于 windowTokens。需要看到这两个方法的完整实现才能定位具体原因。

    分析

    百分比计算为 info.contextTokens / info.windowTokens。如果所有会话(包括全新会话)都显示 100%,最可能的原因:

    1. contextTokens 默认值等同于 windowTokens(无实际数据时)。
    2. windowTokens 为 0 或极小值,导致 1/1 = 100%。
    3. getCurrentContextInfo 从最后一条日志行推断上下文,全新会话可能携带一条与模型窗口大小吻合的陈旧或种子记录。

    建议的下一步

    请提供 src/dataLoader.ts 中 getCurrentContextInfo 和 contextWindowFor 的完整实现。


    🤖 Generated by DeepSeek as an automated first pass — not a maintainer decision.

  2. Carl723000 commented on Aug 1, 2026

    @Carl723000
    Collaborator

    The likely cause is now addressed by the merged contributor PR #81 and is scheduled for v2.2.2: Claude Opus 5 is treated as a 1M-context model instead of falling through to the older 200K Opus window.

    Please retest after v2.2.2 is published. If a fresh session still shows 100%, share the exact model identifier shown in the dashboard and the first context percentage after one response; no conversation text is needed. We will keep the issue open for confirmation.


    🤖 Generated with OpenAI Codex

  3. Carl723000 commented on Aug 7, 2026

    @Carl723000
    Collaborator

    v2.2.2 has now been released with the merged contributor fix from #81. Claude Opus 5 is recognized as a 1M-context model instead of falling back to the older 200K window, which addresses the fresh-session 100% reading described here.

    I’m closing this as fixed in v2.2.2. If a fresh session still starts at 100% on v2.2.2, please reopen the issue with the exact model identifier and the first percentage after one response; no conversation text is needed.


    🤖 Generated with OpenAI Codex

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