Skip to content

Show pace for OpenCode Go CLI usage windows - #2957

Merged
steipete merged 1 commit into
steipete:mainfrom
kentoku24:opencodego-cli-pace
Aug 16, 2026
Merged

Show pace for OpenCode Go CLI usage windows#2957
steipete merged 1 commit into
steipete:mainfrom
kentoku24:opencodego-cli-pace

Conversation

@kentoku24

@kentoku24 kentoku24 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

codexbar usage --provider opencodego now returns pace for both the primary (5-hour rolling) and secondary (weekly) usage windows — in the text output (Pace: ... lines) and in the JSON pace payload (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's pace capability: keep the existing reset-window / inferred-monthly-duration rules (GUI Monthly pace unchanged) and add primary: .session(maximumMinutes: 300) and secondary: .weekly so 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 pass
  • swift test --filter MenuBarPaceTextTests → 2/2 pass
  • swift build → exit 0; CLI --help smoke test shows the opencodego provider
  • SwiftFormat + SwiftLint on the changed files → 0 violations
  • Note: the full make test shard run can abort on pre-existing, environment-dependent Claude OAuth keychain test failures unrelated to this change; make check can report pre-existing violations in unrelated uncommitted work-in-progress files. Both are isolated and documented (not touched here).

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added 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. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 15, 2026, 8:55 AM ET / 12:55 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: a15887deddd90de1be91baada7cdb04c30a217a2

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused coverage are solid, but merge-ready confidence is capped until the changed account-backed CLI path is shown working in a real setup.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports tests and a build, but provides no redacted after-fix CLI transcript from a real OpenCode Go account. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports tests and a build, but provides no redacted after-fix CLI transcript from a real OpenCode Go account. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current behavior: Current main declares only calendar-month reset-window pace for OpenCode Go, so its five-hour and weekly snapshot slots are not classified for CLI pace.
Supported window data: The OpenCode Go snapshot already supplies a 300-minute primary window and a 10,080-minute secondary window, each with a reset time; monthly remains tertiary.
Renderer integration: The shared CLI renderer evaluates primary, secondary, and tertiary slots through the descriptor capability, so adding the two lanes is the existing integration point.
Findings None None.
Security None None.

How this fits together

OpenCode 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]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports tests and a build, but provides no redacted after-fix CLI transcript from a real OpenCode Go account. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The supplied verification is limited to tests and build claims; without a redacted real CLI run, the account-backed OpenCode Go path remains unverified.
  • Complete next step (P2) - A real account-backed CLI run must be supplied by the contributor; there is no safe automated repair that can establish that proof.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +4 net (+5/-1); tests +101 A small provider-metadata change is backed by focused text, JSON, missing-window, and duration-guard coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Preserve the descriptor-level monthly rules and land the added primary and secondary lanes after a redacted live codexbar usage --provider opencodego transcript confirms both text and JSON output.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Preserve the descriptor-level monthly rules and land the added primary and secondary lanes after a redacted live codexbar usage --provider opencodego transcript confirms both text and JSON output.

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.

Labels

Label changes:

  • add P3: This is a low-risk CLI usability enhancement for an optional provider rather than a broken core workflow.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add 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 reports tests and a build, but provides no redacted after-fix CLI transcript from a real OpenCode Go account. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a low-risk CLI usability enhancement for an optional provider rather than a broken core workflow.
  • 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 reports tests and a build, but provides no redacted after-fix CLI transcript from a real OpenCode Go account. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the OpenCode Go descriptor baseline to Peter Steinberger, and the repository is owned by this account. (role: current descriptor contributor; confidence: medium; commits: 0e453c4a5b2a; files: Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted terminal capture of codexbar usage --provider opencodego showing five-hour and weekly pace in text and JSON, then update the PR body for re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@steipete
steipete merged commit 9fc51c3 into steipete:main Aug 16, 2026
9 checks passed
steipete added a commit that referenced this pull request Aug 16, 2026
@kentoku24

Copy link
Copy Markdown
Contributor Author

Live CLI verification — primary/secondary pace now returned

Built the PR head (a15887ded) in a worktree (swift build -c release --product CodexBarCLI, exit 0) and ran codexbar usage --provider opencodego against the local opencode DB (source: local — no network, no Keychain prompts) with ~/.codexbar/config.json (opencodego enabled). Compared against the installed release (CodexBar 0.49.3).

AFTER (PR head a15887d) — text, exit 0

== OpenCode Go (local) ==
5-hour: 93% left [===========-]
Pace: 93% in reserve | Expected 100% used | Lasts until reset
Resets now
Weekly: 79% left [=========---]
Pace: 72% in reserve | Expected 93% used | Lasts until reset
Resets in 1d 7h
Monthly: 75% left [=========---]
Pace: 17% in reserve | Expected 42% used | Lasts until reset
Resets in 17d 22h

AFTER (PR head a15887d) — JSON pace object, exit 0

"pace" : {
  "primary"   : { "deltaPercent" : -93, "expectedUsedPercent" : 100, "stage" : "farBehind", "summary" : "93% in reserve | Expected 100% used | Lasts until reset", "willLastToReset" : true },
  "secondary" : { "deltaPercent" : -72, "expectedUsedPercent" : 93,  "stage" : "farBehind", "summary" : "72% in reserve | Expected 93% used | Lasts until reset",  "willLastToReset" : true },
  "tertiary"  : { "deltaPercent" : -17, "expectedUsedPercent" : 42,  "stage" : "farBehind", "summary" : "17% in reserve | Expected 42% used | Lasts until reset",  "willLastToReset" : true }
}

BEFORE (installed 0.49.3) — text, exit 0

== OpenCode Go (local) ==
5-hour: 93% left [===========-]
Resets in 1m
Weekly: 79% left [=========---]
Resets in 1d 7h
Monthly: 75% left [=========---]
Pace: 17% in reserve | Expected 42% used | Lasts until reset
Resets in 17d 22h

BEFORE JSON pace contains only tertiary (pace.primary / pace.secondary absent) — reproducing the reported "only tertiary returns pace" behavior.

Verdict

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.

@kentoku24
kentoku24 deleted the opencodego-cli-pace branch August 16, 2026 06:09
Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
Finesssee added a commit to nesszer/Win-CodexBar that referenced this pull request Aug 18, 2026
* 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
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.

2 participants