Show pace for OpenCode Go CLI usage windows - #2957
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 15, 2026, 8:55 AM ET / 12:55 UTC. ClawSweeper reviewWhat this changesThe PR enables five-hour primary and weekly secondary pace output for OpenCode Go in the CLI text and JSON renderers, with regression coverage. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain The patch is a focused, correct descriptor-based extension, but it needs real after-fix CLI proof from an OpenCode Go account before merge. Priority: P3 Review scores
Verification
How this fits togetherOpenCode Go fetchers convert account usage into primary, secondary, and monthly usage windows. The provider descriptor classifies those windows for the shared CLI pace renderer, which emits text and JSON usage output. flowchart LR
A[OpenCode Go account usage] --> B[Usage snapshot windows]
B --> C[Provider pace capability]
C --> D[Shared pace calculation]
D --> E[CLI text output]
D --> F[CLI JSON payload]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the descriptor-level monthly rules and land the added primary and secondary lanes after a redacted live Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature extension; the relevant confirmation is an after-fix run against a real OpenCode Go account rather than reproducing an existing failure. Is this the best way to solve the issue? Yes. The descriptor is the established shared capability boundary for CLI pace classification, and the branch preserves the existing monthly reset-window behavior while adding only the two supported snapshot lanes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f15f142a7787. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Live CLI verification — primary/secondary pace now returnedBuilt the PR head ( AFTER (PR head a15887d) — text, exit 0AFTER (PR head a15887d) — JSON
|
| Window | After (a15887d) | Before (0.49.3) |
|---|---|---|
| primary (5-hour, 300 min) | Pace ✅ (pace.primary) |
no Pace ❌ |
| secondary (Weekly, 10080 min) | Pace ✅ (pace.secondary) |
no Pace ❌ |
| tertiary (Monthly, 43200 min) | Pace ✅ (pace.tertiary) |
Pace ✅ (pace.tertiary) |
Usage numbers are identical before/after (6.8% / 20.8% / 24.9% used); only pace presence differs. No secrets in output (local DB source, no cookies/keys), no Keychain prompts.
* Port upstream 0.50.1: Cursor rename + Ollama cookie stripping (steipete#2951, steipete#2949) * Port upstream 0.50.1: OpenCode Go session+weekly pace in CLI (steipete#2957) * Port upstream 0.50.1: chart axis label centering (steipete#2974) * Port upstream 0.50.1: Kiro re-authenticate via kiro-cli login (steipete#2340) * Port upstream 0.50.1: serve identity follows app redaction per-request (steipete#2960) * Port upstream 0.50.1: Codex routed pricing, auth.json read-only, known-zero history, Antigravity dashboard lanes, Claude OAuth revoked detection steipete#2946 Codex routed models pricing — codex_routed_provider() + strip_route_prefix() in cost_pricing.rs; deepseek/, kimi/, opencode/ routes price against matching models.dev provider; unknown provider/ prefixes return None. steipete#2944 Codex auth.json read-only during refresh — codex_external_oauth_sources_allowed setting (default OFF); is_external_oauth + last_refresh fields on CodexCredentials; enforce_external_oauth_gate (8-day staleness window). steipete#2932 Codex known-zero history — known_zero field on CostSummary; set in both cache-debounce and full-scan paths (history_coverage_established && sessions_count == 0); knownZero JSON field + CLI text update. steipete#2963 Antigravity dashboard lanes — quota-bucket dedup in parse_user_status; models sharing the same (remaining_fraction, reset_time) collapse to one lane. steipete#2516 Claude revoked vs missing OAuth — ProviderError::OAuthRevoked variant; revocation detection (401/403 with revoked/invalid_grant/token_revoked); 15-min CLI result cache (LazyLock<Mutex<Option<CachedCliResult>>>); fetch_via_auto returns cached CLI result when OAuth revoked, and stale cache when all live sources fail. * Port upstream 0.50.1: Mistral PAYG spend, cost-summary display style, per-provider accent color Item 1 — Mistral PAYG current-month API spend (steipete#2821, steipete#2947): - Add MonthlyPlan variant to MetricPreference enum - Add currency_symbol field to CostSnapshot with with_currency_symbol builder - Set currency_symbol from Mistral billing API response - Add MonthlyPlan to bridge label/parse, tray selected_metric_percent (None = no bar) - Show formatted cost amount in provider_status_label for MonthlyPlan - Add format_cost_amount helper in bridge.rs - Add Mistral monthly spend row in MenuCardDetails - Add monthlyPlan option to MenuBarMetricSection for Mistral Item 2 — Menu cost-summary display style per provider (steipete#2976): - Add CostSummaryDisplayStyle enum (Compact/Detailed/Hidden) in types.rs - Add cost_summary_display_style field to Settings + Default + RawSettings round-trip - Add to SettingsSnapshot bridge + SettingsUpdate + apply in Tauri commands - Add bridge label/parse functions - Apply in MenuCardDetails: hidden hides cost section, compact shows used/limit only - Update describeCard to filter hasCost for hidden style - Add Select control in UsageSpendTab Item 3 — Per-provider accent color override (steipete#2972): - Add accent_color field to ProviderConfig - Add brand_color(ProviderId) function in provider.rs (mirrors frontend registry) - Add accent_color/set_accent_color/effective_accent_color accessors in Settings - Add set/get/get_effective Tauri commands + normalize_hex_accent_color validator - Add providerAccentColors map to SettingsSnapshot bridge - Add setProviderAccentColor/getProviderAccentColor/getProviderEffectiveAccentColor to tauri.ts - Create AccentColorSection component (hex input, color picker, reset button) - Inject --provider-accent CSS variable on MenuCard article and ChartsSection - Update menu-metric__bar-fill and chart colors to use --provider-accent fallback - Update chartPalette providerCostColor/providerCreditsColor fallback chain - Pass providerAccentColors through TrayPanel/PopOutPanel/ProvidersTab/ProviderDetailPane Also: - Add 11 new locale keys to all 7 .ftl files + keys.ts - Add costSummaryDisplayStyle + providerAccentColors to all test mock SettingsSnapshot - Update chartPalette tests for --provider-accent fallback * Resolve merge conflicts and fix gate checks * Thermo-nuclear: extract ollama cookies, codex pricing, simplify accent color * fix: correct serde attribute placement on currency_symbol after rebase
Summary
codexbar usage --provider opencodegonow returns pace for both the primary (5-hour rolling) and secondary (weekly) usage windows — in the text output (Pace: ...lines) and in the JSONpacepayload (pace.primary/pace.secondary).Previously the CLI pace path covered only
.session(codex/claude/ollama) and.weekly(codex/claude/opencode/ollama) allowlists, so OpenCode Go got no pace on either lane even though its snapshot already carries both windows with reset times. The GUI already showed pace for the OpenCode Go monthly (tertiary) lane; this change brings the CLI in line via the descriptor's pace capability.Scope: CLI-facing pace lanes only. The existing OpenCode Go reset-window (GUI Monthly) pace rules are preserved unchanged. No payload schema, fetcher, or docs changes; the Monthly (tertiary) row in the CLI stays unchanged.
Changes
Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift— extend the descriptor'spacecapability: keep the existing reset-window / inferred-monthly-duration rules (GUI Monthly pace unchanged) and addprimary: .session(maximumMinutes: 300)andsecondary: .weeklyso the CLI returns pace for the 5-hour and weekly windows (+5/-1).Tests/CodexBarTests/CLISnapshotTests.swift— 4 new tests: text pace lines for 5-hour + weekly, JSON payload primary+secondary, primary-only when weekly usage is missing, and the >5h window guard (+101).Verification
swift test --filter CLISnapshotTests→ 52/52 pass (incl. the 4 new tests)swift test --filter ProviderPaceCapabilityTests→ 4/4 passswift test --filter MenuBarPaceTextTests→ 2/2 passswift build→ exit 0; CLI--helpsmoke test shows theopencodegoprovidermake testshard run can abort on pre-existing, environment-dependent Claude OAuth keychain test failures unrelated to this change;make checkcan report pre-existing violations in unrelated uncommitted work-in-progress files. Both are isolated and documented (not touched here).