Repository navigation
Description
Existing issues
- I searched existing issues and did not find a duplicate.
What happened?
This is the same bug class as #267 / #268 / #275, on the last surface that was never covered.
On a ChatGPT Plus account whose Codex rate limits no longer include a 5-hour window, the native tray hover tooltip reads:
CodexBar
Claude: 0%
Codex: No active 5h session
Everything else is already correct — the tray icon, the tray panel rows, the Providers sidebar, the FloatBar and the CLI all show the weekly figure (16% in my case). Only build_tooltip() is wrong.
Why this one was missed
#277 (fix(ui): use real window for compact usage metrics, fixes #275) ticked Settings UI, Provider-specific behavior and FloatBar in its affected-areas list, and explicitly left Tray panel unticked. The native tooltip lives in the Rust tray bridge, not in the React surfaces that PR touched, so it never got the shared policy.
Within tray_bridge.rs itself the fix exists but is applied to only one of the two label builders:
Fixed — provider_status_label(), used for the tray menu rows:
| let window = if snapshot.provider_id == "codex" { |
// F5 (upstream 0.48.0): for Codex, prefer the first non-informational lane so
// a monthly-only plan shows the monthly window with its reset countdown
// instead of the informational "No active 5h session" placeholder.
let window = if snapshot.provider_id == "codex" {
codex_lane_headline_window(snapshot)
} else {
&snapshot.primary
};Not fixed — build_tooltip(), 111 lines further down in the same file:
| let label = crate::commands::compact_tray_status_label(&s.primary, lang); |
let label = crate::commands::compact_tray_status_label(&s.primary, lang);&s.primary goes in unfiltered, and compact_tray_status_label() returns the placeholder's reset_description verbatim:
if window.is_informational {
return window.reset_description.clone().unwrap_or_else(|| "Unavailable".to_string());
}Expected
Codex: 16% • Resets in 3d 17h
Suggested fix
One line — reuse the lane selection that already exists two functions above:
let window = crate::tray_bridge::codex_lane_headline_window(s); // or &s.primary for non-codex
let label = crate::commands::compact_tray_status_label(window, lang);usage_metric::selected_usage_window(s, &settings) would work too and has the bonus of honouring the per-provider provider_metrics preference, which the tooltip currently ignores entirely.
Why the tests didn't catch it
tooltip_uses_compact_status_labels (tray_bridge.rs) builds both snapshots with non-informational primaries:
let mut codex = fake_snapshot("codex", "Codex", 8.0);
codex.primary.reset_description = Some("4h 10m".to_string());A regression case with codex.primary.is_informational = true and a populated secondary would cover this path.
Affected area
- Tray panel
- Settings UI
- Config file / settings persistence
- CLI
- Provider-specific behavior
- Installer / release packaging
- Startup / background behavior
- Other
Steps to reproduce
1. Sign in to Codex with a ChatGPT Plus account whose rate limits return only a
weekly window (primary.window_minutes = 10080, secondary = null) — the same
payload shape described in #267 and #275.
2. Let CodexBar refresh Codex usage.
3. Hover the tray icon.
4. The tooltip line reads "Codex: No active 5h session" with no percentage,
while the tray icon, tray panel rows, Providers sidebar and FloatBar all
correctly show the weekly figure (16%).
Logs, screenshots, or recordings
codexbar-cli.exe usage -p codex --json (v0.54.0)
{
"provider": "codex",
"source": "oauth",
"usage": {
"login_method": "ChatGPT Plus",
"primary": {
"is_informational": true,
"reset_description": "No active 5h session",
"used_percent": 0.0,
"window_minutes": 300
},
"secondary": {
"is_informational": false,
"reset_description": "3d 17h",
"resets_at": "2026-08-27T10:47:41Z",
"used_percent": 14.0,
"window_minutes": 10080
},
"extra_rate_windows": [
{
"id": "reset-credits",
"title": "Reset credits",
"window": { "is_informational": true, "used_percent": 0.0 }
}
]
}
}
Same account, raw rate_limits from every token_count event in
~/.codex/sessions/**/*.jsonl:
2026-05-01 .. 2026-07-12 primary=300min + secondary=10080min (1182 records)
2026-07-17 .. 2026-08-24 primary=10080min, secondary=null (1036 records)
Zero 300-minute windows returned since the switch, including in sessions that
were actively running minutes before the tooltip above was captured. So this is
not "no session started recently" — for this plan the 5h window is simply gone,
which matches the payload shape #267 and #275 were opened about.
Tray tooltip as rendered:
CodexBar
Claude: 0%
Codex: No active 5h session
App version
v0.54.0 (repo state checked: 343bf48, same version)
Windows version
Windows 11 Home 25H2 (build 26200.9168)
Additional context
There is no settings workaround. MenuBarMetricSection lets you pin Codex to the weekly window via provider_metrics, but build_tooltip() never consults provider_metrics or selected_usage_window(), so the tooltip stays wrong whatever you pick. menu_bar_shows_highest_usage is unrelated — it chooses which provider renders in merged mode, not which window.
Happy to send a PR for the one-line change plus the regression test if that's useful.
Activity
Finesssee commentedon Aug 23, 2026
Thanks for the report, I will fix this ASAP. but if u have the chance, pls open a PR.
fix(tray): label the tooltip from the headline lane, not the raw prim…