MiMo: flag a stale local-fallback cache in the summary#1969
MiMo: flag a stale local-fallback cache in the summary#1969LeoLin990405 wants to merge 2 commits into
Conversation
CodexBar only reads the `~/.codexbar/mimo-local-usage.json` cache produced by `Scripts/mimo-usage.py`; it never regenerates it. When no scheduled refresh runs, the cache freezes and the menu keeps showing old totals with an old timestamp, which reads like a broken refresh. Append a `stale <age>` marker (e.g. `stale 34d`) to the Local summary once the cache has not refreshed within 12h, so a frozen tracker is not misread as live usage. Adds focused tests for the stale and fresh paths and documents the marker in docs/mimo.md.
|
Codex review: needs real behavior proof before merge. Reviewed July 8, 2026, 7:19 AM ET / 11:19 UTC. Summary Reproducibility: not applicable. as a PR feature/UX improvement. Source inspection shows current main lacks the stale marker and the PR adds deterministic stale/fresh coverage. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the narrow stale-marker implementation in the MiMo fallback helper, remove the changelog entry, and require redacted real-behavior proof before merge. Do we have a high-confidence way to reproduce the issue? Not applicable as a PR feature/UX improvement. Source inspection shows current main lacks the stale marker and the PR adds deterministic stale/fresh coverage. Is this the best way to solve the issue? Yes, mostly: adding the marker inside MiMoLocalUsageFallback is the narrow maintainable path for this summary text. The merge-ready branch should drop the changelog entry and include real behavior proof. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against aa401f1d8b74. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
…e-indicator # Conflicts: # CHANGELOG.md
What
Flag a stale MiMo local-fallback cache in the menu summary, so a frozen tracker is not misread as live usage.
Why
The MiMo
localfallback (opt-in, added in #1284) reads~/.codexbar/mimo-local-usage.json, a cache produced byScripts/mimo-usage.py. CodexBar only reads this cache — it never regenerates it. If the scheduled refresh (launchd/cron/wrapper post-exec) isn't set up or stops running, the cache freezes: the card keeps showing the sameLocal · … total · … sessionsrow and an old update time, which reads exactly like a broken refresh (hitting ⌘R changes nothing). In practice a cache can sit frozen for weeks whilecc-mimokeeps being used.Change
MiMoLocalUsageFallbacknow appends astale <age>marker (e.g.stale 34d) to theLocal · …summary once the cache'supdated_atis older than a 12h threshold:d/h/m).Tests / docs
swift test --filter MiMoLocalUsageFallback— 7/7 pass, including newflags a cache that has not refreshed within the stale windowanddoes not flag a freshly refreshed cache(deterministicnow).swift buildclean; changed files pass SwiftFormat.docs/mimo.mddocuments the marker;CHANGELOG.md(0.41.1) updated.Backward compatible: only affects the opt-in
localsource, and only when its cache is already stale.