Skip to content

Quiet routine pricing warnings + menubar recovery from stuck-loading#266

Open
iamtoruk wants to merge 2 commits intomainfrom
fix/quiet-warnings-and-menubar-recovery
Open

Quiet routine pricing warnings + menubar recovery from stuck-loading#266
iamtoruk wants to merge 2 commits intomainfrom
fix/quiet-warnings-and-menubar-recovery

Conversation

@iamtoruk
Copy link
Copy Markdown
Member

@iamtoruk iamtoruk commented May 7, 2026

Two issues observed by the user during the 0.9.7 dogfood:

  1. The "no pricing data for model" warning fired on every default codeburn invocation — greeting fresh users with three stderr lines before the dashboard drew. Looked like the tool was broken on first launch.
  2. After a long pause, the menubar popover got stuck on "Loading Today…" with no error and no recovery path. Killing and relaunching the menubar manually fixed it.

CLI

  • Default codeburn is silent on the unknown-model warning. Opt-in via --verbose.
  • Local-model heuristic suppresses the warning entirely for Ollama tags (qwen3.6:35b-a3b-bf16), GGUF / quantized fingerprints (*-bf16, *-q4_K_M, etc.) — those will never have public pricing and the "update codeburn" hint was actively misleading.
  • When the warning does fire, it points at codeburn model-alias <model> <known-model> as the actual escape hatch alongside the package-update suggestion.

Verified:

$ codeburn status                 # silent on stderr
$ codeburn --verbose status       # warning shows with new actionable hint

Menubar

User-facing:

  • FetchErrorOverlay with the actual error message and a Retry button replaces the perpetual loading spinner when a per-key fetch fails and the cache is empty.

Diagnostic-only (NSLog → unified log, invisible to users; only visible via Console.app filter or log stream --process CodeBurnMenubar):

  • Subprocess timeout: CLI subprocess timed out after 45s for status --format menubar-json --no-optimize --provider claude — terminating
  • Cancelled before result applied: fetch for today/claude cancelled before result was applied
  • Calendar rolled mid-fetch: dropping fetch result for today/claude — calendar rolled mid-fetch
  • Stale-key retry: refresh attempt for stale key today/claude — last success was 145s ago

Tracks lastSuccessByKey separately from cache freshness so staleness diagnostics survive day-rollover cache wipes.

Notes

  • The error overlay is a safety net for the same stuck-loading bug we observed; the underlying root cause needs more data, which the new breadcrumbs will provide next time it recurs.
  • Zero new user-visible UI for normal operation; only triggers when there's actually an error to surface.

Test plan

  • npm test — 555/555
  • swift build — clean
  • codeburn status produces zero stderr (default), warns under --verbose
  • Menubar runs cleanly with new diagnostics + overlay code

iamtoruk added 2 commits May 7, 2026 10:16
CLI:

- Default `codeburn` invocation no longer prints "no pricing data for model"
  warnings on every run. Greeting a fresh user with three lines of stderr
  before the dashboard even draws looked like the tool was broken on first
  launch. The warning now requires --verbose, and the suppressed pricing
  miss still results in $0 cost (correct for unmapped models).
- Local-model heuristic skips the warning entirely for Ollama tags
  (`qwen3.6:35b-a3b-bf16`), GGUF/quantized fingerprints, and similar names
  that will never have public pricing. The "update codeburn" hint was
  actively misleading there.
- When the warning does fire (with --verbose), it points users at
  `codeburn model-alias <model> <known-model>` as the actual escape hatch
  alongside the package update suggestion.

Menubar:

- Replace perpetual "Loading…" spinner with a FetchErrorOverlay when the
  per-key fetch fails and the cache is empty. User sees the error and a
  Retry button instead of an infinite hang.
- Add diagnostic breadcrumbs (NSLog, invisible to normal users — Console.app
  / `log stream --process CodeBurnMenubar` only) for the four states that
  produce a stuck loading overlay:
    - subprocess timeout after 45s
    - fetch result dropped due to Task cancellation (rapid tab switch)
    - fetch result dropped due to mid-fetch calendar rollover
    - retry attempt where the last successful fetch is >2 min stale
- Track lastSuccessByKey separately from cache freshness so the staleness
  diagnostic survives day-rollover cache wipes.
When the 30s CLI tick updated `projects` while the user was reading the
model comparison results, the projects-watching effect always fired
setLoadTrigger, which flipped phase to 'loading' and re-ran the slow
scanSelfCorrections walk over every provider's session directory. The
user lost their scroll position and saw a loading flash mid-read.

Recompute the comparison rows in place when:
- the user is already on the results phase, AND
- both picked models still exist in the new aggregate.

Skip the corrections rescan on these in-place refreshes — corrections
drift slowly enough that holding the previous value until the user
re-enters compare is acceptable, and the rescan is the slow part of the
load. Initial selection and post-selection load still run the full
pipeline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant