🤖 perf: the chat-input handoff countdown uses provider usage while Token Budget stages open on the request estimate
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start with src/common/utils/compaction/autoCompactionCheck.ts and src/browser/components/CompactionWarning/CompactionWarning.tsx, then read tests/ipc/tokenBudgetStages.fixture.integration.test.ts and the referenced changes in #7214 and #7332. Trace how the request estimate reaches the renderer and how the countdown is shown. Done when Token Budget mode never displays a handoff countdown after the handoff row has been delivered.
Written by the indexing model from the issue text.
Description
Found by the Codex review of #7332 (thread PRRT_kwDOPxxmWM6vk5R2). The problem already exists on main. No fix is in #7332.
Problem
In Token Budget mode, the chat-input bar counts down with "Handoff target in N% usage". It computes N from provider-reported usage (checkAutoCompaction in src/common/utils/compaction/autoCompactionCheck.ts, rendered by src/browser/components/CompactionWarning/CompactionWarning.tsx). The handoff and final stages open on the request estimate instead:
- Since #7214, the turn start opens a stage when the built request's estimate reaches its point.
- #7332 makes settlement use the same next-request estimate.
The estimate runs above provider usage (OpenAI about 1.3–1.6 times, Claude about 1.04–1.36 times, see #5223). So the handoff row can already be delivered while the bar still shows "Handoff target in N% usage". At a 70% target and 1.3–1.6 times, the handoff comes at about 44–54% provider usage. The bar stays hidden until 60%.
Evidence
- On main, the fixture test "estimate-only crossing (R2a)" in
tests/ipc/tokenBudgetStages.fixture.integration.test.tsdelivers a handoff while saved usage stays far below every stage point. CompactionWarning.tsxbuilds the countdown text fromusagePercentageonly.
Options
- Show the request estimate in the bar: send the last request estimate to the renderer and count down from it.
- Drop the countdown in Token Budget mode: show only "Past the handoff target" after the handoff row exists, and no percentage before.
Acceptance
- In Token Budget mode, the bar never shows a countdown to a handoff that the window already received.
Refs #5223, #7214, #7332.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $527.71
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 140
- Avg merge
- 4h 57m
- Merged PRs (30d)
- 946
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/xum
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
🤖 fix: a Daytona connection test started before a settings save can show the old key as connectedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
Similar issues
-
bug require-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
expressjs/expressjs.com#2549 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
umami-software/umami#4686 · 1 comment ·
Maintainers usually reply within 2 days
-
[Bug]: Device screenshot fails with 500 on iPhone Duo (Xcode 27.2): serve-sim calls simctl without --displayPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
pingdotgg/t3code#24900 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
inu-appcenter/UNIDorm-web#411 ·
Maintainers usually reply within 1 day
-
🐛 bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days