-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
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_percentagestarts at 0% on session start or resume, regardless of existing context- It grows disproportionately to actual context usage reported by
/contextuntil it maxes out at 100% /contextreports 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
- Configure the status line script in
~/.copilot/config.json(see example below) - Enable the experimental status line feature: run
/experimental onand restart Copilot CLI - Start a new session and exchange several messages
- Compare the status line's reported percentage with
/contextoutput - Continue exchanging messages and observe the status line percentage grow while
/contextremains stable - Exit and resume session.
- Status line percentage resets to 0.
- 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
Reactions are currently unavailable