Repository navigation
Show tertiary window label instead of 'Extra' for OpenCode Go monthly bar - #197
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ceiling | 21e3e83 | Commit Preview URL Branch Preview URL |
Aug 03 2026, 04:12 AM |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change adds optional tertiary usage-window labels to Rust snapshots, bridge payloads, and TypeScript presentation. OpenCodeGo labels its monthly window as “Monthly”. Desktop test fixtures initialize the new field. ChangesTertiary label propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant OpenCodeGo
participant UsageSnapshot
participant Bridge
participant capacityPresentation
OpenCodeGo->>UsageSnapshot: assign "Monthly" tertiary label
UsageSnapshot->>Bridge: serialize tertiary_label
Bridge->>capacityPresentation: provide tertiaryLabel
capacityPresentation-->>capacityPresentation: display label or "Extra"
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🟢 Ready to approve
The new tertiary label field is correctly added to the shared model, serialized through the camelCase bridge, and consumed by the UI with an appropriate fallback, with no issues found in the reviewed diffs.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR fixes the Activity timeline’s tertiary (monthly) bar label for the OpenCode Go provider by introducing a dedicated tertiary label field in the shared Rust usage model and wiring it through the Tauri bridge to the React frontend, so the UI can display a provider-defined name instead of the generic “Extra” fallback.
Changes:
- Added
tertiary_label: Option<String>toUsageSnapshotplus awith_tertiary_label()builder. - Set the OpenCode Go monthly window’s label to
"Monthly"when monthly usage is present. - Plumbed the new field through the Rust→TS bridge (
tertiary_label→tertiaryLabel) and updated the frontend presentation logic to prefer it over the “Extra” fallback.
File summaries
| File | Description |
|---|---|
| rust/src/providers/opencodego/mod.rs | Sets the tertiary window label to "Monthly" when monthly usage is available. |
| rust/src/core/usage_snapshot.rs | Adds tertiary_label to the shared usage snapshot model and a builder to set it. |
| apps/desktop-tauri/src/types/bridge.ts | Extends the TS bridge type to include tertiaryLabel?: string. |
| apps/desktop-tauri/src/lib/capacityPresentation.ts | Uses provider.tertiaryLabel when computing the tertiary window label, falling back to "Extra". |
| apps/desktop-tauri/src-tauri/src/commands/bridge.rs | Adds tertiary_label to the Rust bridge struct and maps it from UsageSnapshot. |
| apps/desktop-tauri/src-tauri/src/tray_bridge.rs | Updates test snapshots/fixtures to include tertiary_label: None. |
| apps/desktop-tauri/src-tauri/src/taskbar_widget.rs | Updates test snapshots/fixtures to include tertiary_label: None. |
| apps/desktop-tauri/src-tauri/src/quota_run_history.rs | Updates test snapshots/fixtures to include tertiary_label: None. |
| apps/desktop-tauri/src-tauri/src/powertoys.rs | Updates test snapshots/fixtures to include tertiary_label: None in two test fixtures. |
| apps/desktop-tauri/src-tauri/src/enforcement.rs | Updates test snapshots/fixtures to include tertiary_label: None. |
| apps/desktop-tauri/src-tauri/src/capacity_events.rs | Updates test snapshots/fixtures to include tertiary_label: None. |
| apps/desktop-tauri/src-tauri/src/auto_refresh.rs | Updates test snapshots/fixtures to include tertiary_label: None (including a fixture with a tertiary window). |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 0
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
## Summary Prepares **Ceiling 1.5.22**, carrying three changes merged since v1.5.21: - **#198** - Fix 1% usage reading as 100% across providers (OpenCode Go, OpenCode, Qoder, Chutes, Sakana) - **#197** - OpenCode Go monthly bar labeled "Monthly" instead of "Extra" - **#196** - Fix Microsoft Store installer parameters (40-char Partner Center limit) Bumps all version sources to 1.5.22 (build 124), moves the Unreleased CHANGELOG section into a versioned 1.5.22 entry (adding the missing #196/#197 notes), and adds `.github/release-notes-1.5.22.md`. ## Changes - `CHANGELOG.md` - retitle Unreleased to `[Ceiling] 1.5.22 - 2026-08-03`, add #196/#197 entries - `version.env` - `MARKETING_VERSION=1.5.22`, `BUILD_NUMBER=124` - `rust/Cargo.toml`, `apps/desktop-tauri/src-tauri/Cargo.toml`, `apps/desktop-tauri/package.json`, `apps/desktop-tauri/src-tauri/tauri.conf.json`, `Cargo.lock` - version 1.5.22 - `.github/release-notes-1.5.22.md` - new release notes ## Validation `powershell.exe -ExecutionPolicy Bypass -NoProfile -File scripts\local-check.ps1 -All -Version 1.5.22` passes, including the release doctor for 1.5.22 (all version sources consistent, CHANGELOG mentions 1.5.22) and the Store submission preparation test. Expected pre-tag warnings only: local tag v1.5.22, local release assets, and GitHub release not found yet. After this merges and checks are green, push annotated tag `v1.5.22` to trigger the `Signed Windows Release` workflow. Co-authored-by: tsouth89 <tsouth89@users.noreply.github.com>
## Summary The taskbar strip picks the constraining usage window and shows its label, but for the tertiary window it hardcoded the label to `"Extra"` and ignored the `tertiary_label` that #197 added to the data model. OpenCode Go's monthly bar therefore still read "Extra" on the taskbar even though the React surfaces (flyout, activity timeline) correctly showed "Monthly". The native `taskbar_widget.rs` is the mirror of `capacityPresentation.ts`'s `constrainingWindow` (SOU-288); #197 updated the frontend but not this mirror. This change aligns them: the strip now uses `snapshot.tertiary_label` with `"Extra"` as the fallback when no label is set. ## Changes - `apps/desktop-tauri/src-tauri/src/taskbar_widget.rs` - use `tertiary_label.as_deref().or(Some("Extra"))` in `constraining_readout`; add regression tests for both the labeled ("Monthly") and unnamed (falls back to "Extra") tertiary paths. ## Validation - `cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml`: 466 passed (taskbar_widget: 28 passed, including the 2 new regression tests, which fail against the old hardcode). - `cargo fmt --all` clean; `cargo clippy --all-targets -- -D warnings` clean. Co-authored-by: tsouth89 <tsouth89@users.noreply.github.com>
## Summary OpenCode migrated their web workspace UI to a new Console API surface (`/console/api/...`). Accounts that migrated no longer get usable data from the old `/workspace/<id>/go` scraper this fork's OpenCode Go provider used exclusively, so usage fetches were breaking for those accounts. This ports the Console fallback from [Win-CodexBar#600](nesszer/Win-CodexBar#600) (merged upstream 2026-09-22, unreleased): the provider now tries the Console API first and falls back to the legacy scraper only when a legacy `auth` cookie is present and the Console attempt fails recoverably. **Scoped down from the upstream port** — this fork doesn't have the `local`/`usage_api` SourceMode infrastructure (local-SQLite reads, API-key mode) that upstream's PR #600 builds on, so those aren't included here. This only adds the Console-first + legacy-fallback + fail-closed-on-malformed-data behavior, fetched synchronously (no background Zen-balance task scheduling like upstream's F15 concurrency work). ## What's preserved This fork has 5 independent local fixes on the same file that upstream's history doesn't share. All are re-applied to the new Console path too, not just kept on the legacy path: - Percent-scale ambiguity handling (#198) - "Monthly" tertiary label instead of generic "Extra" (#197) - "Rolling (5h)" session label (#201) - Not reporting the Zen balance as spend — it's remaining credit, not cost (#208) - Missing reset time stays `None` instead of fabricating "resets now" (#213) ## Structure Split `mod.rs` into: - `console.rs` — the new Console API (workspace discovery, usage, billing) - `legacy.rs` — the prior scraper, relocated with its fixes intact - `mod.rs` — orchestrates Console-first with legacy fallback Also improves error reporting: when both Console and legacy fail, the surfaced error now includes both failure reasons instead of silently preferring one and hiding the other — this caught a live diagnosis issue during testing where the real Console failure was hidden behind a generic legacy error. ## Test plan - `cargo test --manifest-path rust/Cargo.toml --lib` — 1283 passed, 0 failed - `cargo clippy --manifest-path rust/Cargo.toml --lib --tests -- -D warnings` — clean - `cargo fmt --all -- --check` — clean - Verified live against a migrated OpenCode Go account (Console fetch now succeeds) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * OpenCode Go usage and balance information is available for accounts using either the Console or legacy experience. * Workspace selection is supported, and available Zen balance appears alongside usage information. * **Bug Fixes** * Usage retrieval can fall back to the legacy experience when Console requests encounter recoverable errors and a legacy login is available. * Balance lookup failures no longer prevent usage information from being retrieved. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Add OpenCode Go Console API path with legacy fallback > - Ports the OpenCode Go Console usage path from Win-CodexBar. Cookie fetches now try the Console API first (usage, balance, workspace discovery) and only retry the legacy page scraper when a recoverable failure occurs and a legacy auth cookie exists. A Console no-subscription result is terminal. > - Splits the legacy implementation into [legacy.rs](https://github.com/tsouth89/ceiling/pull/465/files#diff-e392af3466d20d33f57a3cf028fe5a14f5d12b6b5fee799b8b484fc47bc2aaa1) and the new Console client into [console.rs](https://github.com/tsouth89/ceiling/pull/465/files#diff-913e7c7295e626402e2490579eaca77e8c561671e5664477b3b9f936a83a17e9); orchestration stays in [mod.rs](https://github.com/tsouth89/ceiling/pull/465/files#diff-9dea407bc92536ed25c9c92a8485cdab1e291dbfa64f306211b75eedde52189e). > - Console usage parses microcent meters into rolling, weekly, monthly, and renewal windows, and reports prepaid balances only for explicit pay-as-you-go accounts. > - Workspace ID overrides now accept validated `wrk_`/`org_` IDs or matching OpenCode URLs; invalid values are rejected instead of passed through. > - Behavioral Change: dual authentication failure now returns a combined error that preserves `AuthRequired`; legacy fallback requires a legacy cookie (`auth` or `__Host-auth`), and `org_` overrides force legacy workspace discovery. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 8b8308f.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here --> --------- Co-authored-by: Tyler <tsouth2@gmail.com>
Summary
The tertiary (monthly) bar in the Activity timeline showed "Extra" as its label instead of the window's actual purpose. This was because the tertiary rate window had no label field in the data model to carry a display name, unlike the primary and secondary windows.
Changes
tertiary_label: Option<String>toUsageSnapshotwith awith_tertiary_label()buildertertiary_label = "Monthly"in the OpenCode Go provider when monthly usage is availabletertiary_labelthrough the Tauri bridge to the frontend astertiaryLabelcapacityPresentation.tsto use the provider-defined label, falling back to "Extra" when not setVerification
cargo fmtandcargo clippy: clean (both crates)cargo test(codexbar): 780 passedcargo test(tauri app): 464 passedSummary by CodeRabbit
New Features
Bug Fixes