Skip to content

Status line used_percentage does not reflect actual context window usage #1957

@cmanfre4

Description

@cmanfre4

Describe the bug

Status line used_percentage does not reflect actual context window usage

The context_window.used_percentage field in the status line JSON does not match the context utilization reported by /context.

Observed behavior

  • used_percentage starts at 0% on session start or resume, regardless of existing context
  • It grows disproportionately to actual context usage reported by /context until it maxes out at 100%
  • /context reports stable, plausible values throughout (e.g. ~20-22%)
Point in session Status line used_percentage /context
After resume, before first message 0% ~20%
After first post-resume message 16% ~20%
After several more exchanges 100% 22%

Affected version

v1.0.3

Steps to reproduce the behavior

  1. Configure the status line script in ~/.copilot/config.json (see example below)
  2. Enable the experimental status line feature: run /experimental on and restart Copilot CLI
  3. Start a new session and exchange several messages
  4. Compare the status line's reported percentage with /context output
  5. Continue exchanging messages and observe the status line percentage grow while /context remains stable
  6. Exit and resume session.
  7. Status line percentage resets to 0.
  8. Repeat Steps 3, 4, and 5.

Minimal script to reproduce -- displays used_percentage as reported in the status line JSON:

#!/usr/bin/env bash
input=$(cat)
used=$(echo "$input" | jq -r '.context_window.used_percentage // "n/a"')
echo "ctx: ${used}%"

Config in ~/.copilot/config.json:

{
  "status_line": {
    "type": "command",
    "command": "/absolute/path/to/statusline.sh"
  }
}

Expected behavior

used_percentage should reflect the same context window utilization as /context

Additional context

  • Copilot CLI v1.0.3
  • macOS 15 (Darwin 24.6.0)
  • Status line feature enabled via /experimental on

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loading

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions