Skip to content

Port upstream CodexBar 0.54.0 - #353

Merged
Finesssee merged 16 commits into
mainfrom
port/upstream-0.54.0
Aug 22, 2026
Merged

Port upstream CodexBar 0.54.0#353
Finesssee merged 16 commits into
mainfrom
port/upstream-0.54.0

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

Ports the Windows-applicable behavior from upstream CodexBar v0.54.0 into the Rust/Tauri rewrite. This is a behavior port from tag-pinned upstream sources, not a Swift code transplant and not a Win-CodexBar release/version bump.

Ported

  • Amp current Amp <plan> Subscription: parsing while retaining legacy format (982ca9069).
  • Fireworks account auto-discovery, ambiguity handling, stale-slug recovery, and slug validation (33e6e6558).
  • OpenCode Go authenticated usage API with local/API/web fallback ordering (00598dae1).
  • Codex personal access token usage source with whoami + /wham/usage and narrow Auto fallback (a91646c16).
  • GPT-5.6 Terra/Luna request-day historical pricing, including cached day folds (bed146c63).
  • Show pace preference, default on; hides pace visualization, on-pace budgets, and forecast text together (06b36572f).
  • Antigravity serve filtering for known untouched model families while preserving unknown-zero/global-reset states (99234b5c3).
  • OpenCodex subscription fan-out into Codex/OpenCode Go/Kimi/DeepSeek and routed-model exclusion from native Codex accounting (670f05333).
  • Shared Usage & Spend / Overview spend catalog with enabled+connected provider coverage, honest unknown coverage, xAI daily Management spend, Grok local session tokens, OpenRouter exact 30-day Management Activity spend, cost+token rows, same-revision refresh coalescing, Copy JSON, and native Save JSON (155d82505, c5f7625bc).
  • Applicable Simplified Chinese provider-detail pricing localization, Usage & Spend/custom-pricing docs, and Stream Deck codexbar serve integration docs (fc7040e39).
  • Korean local Codex cost text was already equivalent in the shipped locale and remains unchanged.

Skipped with evidence

  • Codex Drain processed zero-row files from Codex cost catch-up steipete/CodexBar#3075 zero-row pending-file drain: upstream bug is in a pending-file/active-lookback queue that this Windows scanner does not have. Local date-directory selection plus successful-full-scan stale-marker clearing already provides the relevant self-healing behavior.
  • SwiftUI blank Settings restoration, AppKit cached-row selection, Swift chart-hover geometry, Swift child-process stdin teardown, swift-corelibs Bundle.allBundles crash: no Windows/Tauri/Rust counterpart.
  • Upstream custom menu-bar token/conditional/line-break/direct-lane layout wave: Win-CodexBar has no matching MenuBarLayout token language/editor.
  • claude-swap retained polling state: no local cswap backend/store.
  • German About correction: Win-CodexBar does not ship a German locale, so two strings do not justify inventing an otherwise unsupported locale.

Deferred: none. Every v0.54.0 release-note item has a PORT or SKIP disposition.

Validation

  • cargo fmt --all -- --check PASS.
  • cargo clippy --workspace --all-targets -- -D warnings PASS.
  • cargo test --workspace: 1320/1321 PASS locally. The only failure is the known CodexPro PTY environment limitation cli::tty_runner::tests::test_run_sends_script_through_pty -> BinaryNotFound("cmd"); this PR requires hosted Windows CI to pass the full workspace suite before merge.
  • Frontend Vitest: 44 files, 270/270 PASS.
  • TypeScript check + Vite production build PASS (187 modules).
  • Interaction guard tests: 9/9 PASS.
  • git diff --check PASS.
  • Focused provider/accounting suites additionally pass for Amp, Fireworks, OpenCode Go, Codex PAT, pricing, Antigravity, OpenRouter (13/13), SpendContract (8/8), Grok local sessions, xAI (12/12), and locale coverage.
  • scripts/local-check.ps1 was not accepted as evidence locally because this shell environment fails to initialize $LASTEXITCODE when its cargo shim does not execute. The exact hosted CI commands above were therefore run directly with the real Cargo/Node binaries.

Fresh Windows / CUA proof

Fresh desktop build from the committed branch head:

tauri build --debug --no-bundle -> target/debug/codexbar-desktop-tauri.exe PASS.

CUA proof on that binary:

  • proof-054-show-pace.png: Settings -> Menu exposes Show pace; UIA helper text confirms it controls usage pace, on-pace budgets, and forecast text.
  • proof-054-usage-spend.png: Settings -> Usage & Spend exposes separate Copy JSON and Save JSON… controls.
  • proof-054-openrouter-management.png: Settings -> Providers -> OpenRouter exposes a separate Management API key input; UIA help explicitly scopes it to exact 30-day Activity spend from openrouter.ai and keeps the primary API key separate.

No credential was entered during proof. One proof process retained only its float bar after the settings window was closed; it was not force-terminated.

Upstream interaction

No issues, PRs, comments, pushes, or other writes were made to steipete/CodexBar. Upstream was used only through public tag-pinned release/source history.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Thermo-Nuclear Code Quality Review — APPROVE

Verdict

Well-structured port. New capabilities properly modularized. No structural regressions.

Findings

1. Structural regressions — None. 58 files, +2767/-187. Largest growth is usage_spend.rs (+358, 130→490). No file crosses 1k. Pre-existing over-1k files (bridge.rs 1031, settings.rs 1162) receive minimal additions (+19, +30) — not regressions from this PR.

2. Code-judo — One minor nit, not a blocker. build_fetch_context has two near-identical branches for Kimi and OpenCodeGo API-key Auto preservation. Could collapse to (has_kimi || has_opencodego), but keeping them separate preserves the ability to add provider-specific logic. Not worth changing.

3. Spaghetti / branching — Clean. The build_usage_spend_summary match block dispatches by provider ID to produce SpendValues. Each branch is well-scoped with genuinely different spend semantics. This is a dispatch table, not spaghetti. The OpenCodex routing uses a typed RouteTarget enum with clean route_entryroute_modelroute_provider chain. Model prefix wins over provider label.

4. Type/boundary — Clean. CostDailyPoint (core), CostDailyPointBridge (shell), UsageSpendDailyPoint (DTO) follow existing core→bridge→DTO layering. SpendValues separates computation from serialization. CachedUsageSpendSummary with OnceLock<Mutex<Option<...>>> is the standard process-cache pattern — holding the mutex during build coalesces concurrent callers. Cache key includes provider revisions + date + settings flags.

5. New files — Well-modularized. Each of the 5 new files owns one capability: PAT usage (183 lines), Grok local sessions (175), OpenCode Go usage API (125), OpenRouter Activity parser (217), Antigravity idle filtering (64). No god-objects, no thin wrappers.

6. Provider-specific logic in shared paths — Acceptable. build_fetch_context adds an OpenCodeGo branch next to existing Kimi branch — follows the pattern. make_windows adds an Antigravity-specific branch for idle-family filtering, gated by provider_id == "antigravity" and delegates to a dedicated function. A trait method per provider would be over-engineering for one special case.

7. Historical pricing — Clean. codex_cost_usd_at_date is date-gated: pre-2026-07-30 Terra/Luna uses old rates, otherwise falls through to current pricing. No branching complexity leaks into callers.

8. Test quality — Strong. OpenCodex routing tests cover provider-label vs model-prefix precedence. Fireworks covers empty/single/multiple slug discovery. Codex PAT covers token parsing, user-agent normalization, fallback narrowness. Historical pricing verifies rate changes at exact cutoff. Antigravity covers known-idle, unknown-zero, global-reset. OpenRouter Activity covers dedup, range filtering, conflict detection.

Approval

No structural regression, no file-size explosion, no spaghetti growth, no hacky abstractions, no boundary leaks. Approve.

@Finesssee
Finesssee merged commit cdd442c into main Aug 22, 2026
1 check failed
@Finesssee
Finesssee deleted the port/upstream-0.54.0 branch August 22, 2026 13:39
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