-
-
Notifications
You must be signed in to change notification settings - Fork 253
Closed
Description
Summary
Entering an in-progress thread can cause the bottom-left sidebar usage bars (Session, Weekly) to briefly show correct values, then flip to 100%, sometimes recover, and then get stuck at 100%.
Reproduction
- Enable Settings → Display → Show remaining Codex limits.
- Open a workspace with active/in-progress thread activity.
- Enter/switch into the in-progress thread.
- Observe the sidebar usage bars.
Actual
- Usage values can oscillate between correct values and
100%. - In some runs, both bars eventually remain stuck at
100%.
Expected
- Sidebar usage bars should only change when valid usage values actually change.
- Partial rate-limit updates must not overwrite known-good usage values.
- Unknown usage should render as unknown (
--), not fabricated values.
Root Cause (frontend)
Rate-limit normalization currently defaults missing numeric fields to 0 and is used for both:
- explicit
account/rateLimits/readrefresh responses, and - live
account/rateLimits/updatedevents.
When incoming payloads are partial (for example, missing usedPercent / used_percent), the normalizer can coerce usage to 0. In remaining mode, that is rendered as 100% remaining, producing the observed flash/stuck behavior.
Proposed Fix
- Make rate-limit normalization merge-aware:
- preserve previous known-good
usedPercentwhen incoming payload omits usage values; - support both used-style and remaining-style percent fields;
- avoid fabricating usage from absent fields.
- preserve previous known-good
- Apply merge-aware normalization in both refresh and live-event paths before reducer updates.
- Add regression tests for:
- partial payloads preserving prior usage,
- missing percent fields not becoming fake
100%, - event + refresh path behavior.
Acceptance Criteria
- No false
100%usage flashes during thread entry/resume. - No stuck
100%state from partial rate-limit updates. - Existing valid updates still propagate immediately.
- Targeted tests and typecheck pass.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels