Skip to content

MiMo: flag a stale local-fallback cache in the summary#1969

Open
LeoLin990405 wants to merge 2 commits into
steipete:mainfrom
LeoLin990405:fix/mimo-local-stale-indicator
Open

MiMo: flag a stale local-fallback cache in the summary#1969
LeoLin990405 wants to merge 2 commits into
steipete:mainfrom
LeoLin990405:fix/mimo-local-stale-indicator

Conversation

@LeoLin990405

Copy link
Copy Markdown
Contributor

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 local fallback (opt-in, added in #1284) reads ~/.codexbar/mimo-local-usage.json, a cache produced by Scripts/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 same Local · … total · … sessions row 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 while cc-mimo keeps being used.

Change

MiMoLocalUsageFallback now appends a stale <age> marker (e.g. stale 34d) to the Local · … summary once the cache's updated_at is older than a 12h threshold:

Local · 32.2M total · 520 sessions · stale 34d
  • Fresh caches are unchanged (no marker within 12h).
  • Local accounting is still not rendered as a quota percentage; only the summary text gains the marker.
  • Age is humanized (d/h/m).

Tests / docs

  • swift test --filter MiMoLocalUsageFallback — 7/7 pass, including new flags a cache that has not refreshed within the stale window and does not flag a freshly refreshed cache (deterministic now).
  • swift build clean; changed files pass SwiftFormat.
  • docs/mimo.md documents the marker; CHANGELOG.md (0.41.1) updated.

Backward compatible: only affects the opt-in local source, and only when its cache is already stale.

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.
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 8, 2026, 7:19 AM ET / 11:19 UTC.

Summary
The branch appends a stale <age> suffix to MiMo local fallback summaries, adds deterministic stale/fresh tests, updates MiMo docs, and adds a changelog entry.

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: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Remove the release-owned CHANGELOG.md entry.
  • [P1] Add redacted real behavior proof showing the stale MiMo local summary in a real setup.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body and comments list tests/build output only; add redacted menu proof, a recording, terminal/live output, or logs showing the stale marker in a real setup. After updating the PR body, ClawSweeper should re-review automatically; if not, ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] Contributor real-behavior proof is still missing, so the review cannot confirm the stale marker in a real menu or CLI-visible setup.
  • [P1] The PR still edits release-owned CHANGELOG.md, which should be removed before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the narrow stale-marker implementation in the MiMo fallback helper, remove the changelog entry, and require redacted real-behavior proof before merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Human review should wait for contributor-supplied real behavior proof and a small changelog cleanup; there is no autonomous replacement branch needed.

Security
Cleared: No concrete security or supply-chain regression was found; the diff formats an already-read local cache timestamp and updates tests/docs.

Review findings

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:9
Review details

Best 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:

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:9
    This PR still adds an unreleased CHANGELOG.md entry, but release notes are owned by the release flow. Move the context to the PR body or commit message and let release tooling update the changelog.
    Confidence: 0.88

Overall correctness: patch is correct
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against aa401f1d8b74.

Label changes

Label justifications:

  • P3: This is low-risk UX polish for an opt-in MiMo local fallback and the remaining blocker is proof plus small merge cleanup.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body and comments list tests/build output only; add redacted menu proof, a recording, terminal/live output, or logs showing the stale marker in a real setup. After updating the PR body, ClawSweeper should re-review automatically; if not, ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

What I checked:

Likely related people:

  • LeoLin990405: The merged MiMo local fallback PR added the helper, tests, script, and docs that this PR now extends. (role: local fallback feature owner and recent area contributor; confidence: high; commits: f5fa8138092d; files: Sources/CodexBarCore/Providers/MiMo/MiMoLocalUsageFallback.swift, Tests/CodexBarTests/MiMoLocalUsageFallbackTests.swift, docs/mimo.md)
  • steipete: The related merged fallback PR includes owner-side repair/product-acceptance comments and several hardening commits on the MiMo local fallback path. (role: owner-side reviewer and recent area contributor; confidence: high; commits: ca5d595e36ed, 44af7b7054c7, aa497f55cd3f; files: Sources/CodexBarCore/Providers/MiMo/MiMoLocalUsageFallback.swift, Sources/CodexBarCore/Providers/MiMo/MiMoProviderDescriptor.swift, Sources/CodexBarCLI/CLIUsageCommand.swift)
  • debpramanik: MiMo provider history includes the original token-plan usage tracking work that established the provider snapshot and test area extended by later local fallback behavior. (role: original MiMo provider contributor; confidence: medium; commits: f9a2918afcf1; files: Sources/CodexBarCore/Providers/MiMo/MiMoProviderDescriptor.swift, Sources/CodexBarCore/Providers/MiMo/MiMoUsageSnapshot.swift, Tests/CodexBarTests/MiMoProviderTests.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-07T09:52:15.157Z sha 2ea2f2e :: needs real behavior proof before merge. :: [P3] Remove the release-owned changelog entry

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant