Skip to content

Make weekly usage parsing optional for OpenCode Go#1788

Merged
steipete merged 1 commit into
steipete:mainfrom
mohkg1017:fix-opencode-go-parsing
Jul 1, 2026
Merged

Make weekly usage parsing optional for OpenCode Go#1788
steipete merged 1 commit into
steipete:mainfrom
mohkg1017:fix-opencode-go-parsing

Conversation

@mohkg1017

@mohkg1017 mohkg1017 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

OpenCode Go recently changed its dashboard response and can omit the weekly usage window. CodexBar then rejected an otherwise valid rolling window and fell back to Zen balance.

What changed

  • Accept rolling-only seroval and JSON payloads.
  • Preserve weekly-window absence through the snapshot model, so the menu omits the secondary row instead of inventing 0% usage.
  • Retain nested weekly-window recovery for wrapped response shapes.
  • Keep this PR scoped to parsing; the unrelated multi-workspace probe was removed from the branch.

Proof

  • Exact reviewed head: 0045897835c55ece328222af7d3c2e90d3ad094d, based on origin/main at 101c178019491d9e9310b3b51a5e0e9b85b359ab.
  • Before the fix, two rolling-only fixtures fail on origin/main with parseFailed("Missing usage fields.").
  • swift test --filter OpenCodeGo — 63/63 passing across 6 suites.
  • make check — passing, zero SwiftLint violations.
  • Source-blind compiled-artifact contract (swift test --skip-build --filter OpenCodeGoUsageParserTests) — 27/27 passing, including Seroval and JSON rolling-only cases, nested weekly recovery, and missing-required-field rejection.
  • make test — all 44 shards passing on the exact reviewed head.
  • ./Scripts/package_app.sh — release build, widget extension, assembly, and local signing passed; exact-head CodexBar.app created without launching it.
  • Autoreview (gpt-5.5, high reasoning) — clean, no accepted/actionable findings (0.86).
  • Exact-head CI passed all 10 checks: run 28531425860.

Fixtures cover both seroval and JSON dashboard shapes. Maintainer decision: fixture-only proof is accepted for this bounded parser change. A live account/browser-cookie/Keychain probe was intentionally not run because repository policy requires safe parser fixtures when behavior can be verified without prompting for secrets.

@clawsweeper

clawsweeper Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 12:23 PM ET / 16:23 UTC.

Summary
The branch makes OpenCode Go weekly usage optional in parsing and snapshot projection, adds rolling-only parser regression coverage, and updates the OpenCode Go docs and changelog entry.

Reproducibility: yes. By source inspection, current main requires weeklyUsage percent/reset fields before returning an OpenCode Go snapshot, and the PR adds rolling-only Seroval and JSON fixtures for that exact failure shape.

Review metrics: 3 noteworthy metrics.

  • Diff footprint: 5 files, +131/-33. The changed surface is bounded to one provider parser/snapshot path, focused tests, docs, and a changelog entry.
  • Exact-head validation reported: 63/63 focused tests, 44 shards, make check, source-blind parser contract, package_app. Owner-accepted terminal proof covers the parser repair without unsafe live account or Keychain probing.
  • GitHub check state: 5 successful, 4 macOS queued/in progress. The remaining uncertainty is normal required-check completion, not a code-review finding.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Wait for the required macOS CI jobs on head 0045897 to complete before merge.

Risk before merge

  • [P1] Required macOS CI jobs were still queued or in progress at inspection time; this is ordinary branch-protection gating rather than a patch defect.

Maintainer options:

  1. Decide the mitigation before merge
    Merge the focused parser/snapshot fix after required checks pass, while leaving OpenCode Go multi-workspace behavior to the separate product discussion.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair is needed; maintainer review and ordinary required-check completion are the remaining actions.

Security
Cleared: The diff is limited to parser/snapshot behavior, tests, docs, and changelog text, with no dependency, CI, script, permission, secret, or auth-storage changes.

Review details

Best possible solution:

Merge the focused parser/snapshot fix after required checks pass, while leaving OpenCode Go multi-workspace behavior to the separate product discussion.

Do we have a high-confidence way to reproduce the issue?

Yes. By source inspection, current main requires weeklyUsage percent/reset fields before returning an OpenCode Go snapshot, and the PR adds rolling-only Seroval and JSON fixtures for that exact failure shape.

Is this the best way to solve the issue?

Yes. Making weekly usage optional while keeping rolling usage required and preserving hasWeeklyUsage through snapshot projection is the narrowest maintainable fix; multi-workspace behavior remains separate product work.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 101c17801949.

Label changes

Label justifications:

  • P2: This fixes a real OpenCode Go usage-display parser failure with limited blast radius to one provider.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Owner comments accept exact-head fixture-only terminal proof for this bounded parser repair, with live browser-cookie and Keychain probes intentionally excluded by repository policy.
  • proof: sufficient: Contributor real behavior proof is sufficient. Owner comments accept exact-head fixture-only terminal proof for this bounded parser repair, with live browser-cookie and Keychain probes intentionally excluded by repository policy.
Evidence reviewed

What I checked:

Likely related people:

  • Zihao-Qi: Blame and file history show the current OpenCode Go parser, snapshot, local reader, and tests were introduced in the broad OpenCode Go rewrite that owns the current weekly-required behavior. (role: recent area contributor; confidence: high; commits: 3091ff966fff; files: Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift, Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageSnapshot.swift, Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoLocalUsageReader.swift)
  • steipete: Owner comments accepted the exact-head parser proof, and recent OpenCode Go balance/local-usage commits were co-authored by Peter Steinberger on the same fetcher/snapshot/test surface. (role: proof reviewer and recent adjacent contributor; confidence: high; commits: 3091ff966fff, 7754035e6bb5, 6b0a0e504b39; files: Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift, Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageSnapshot.swift, Tests/CodexBarTests/OpenCodeGoUsageParserTests.swift)
  • Ratul Sarna: The original OpenCode Go provider support commit added the provider descriptor, usage fetcher, snapshot, and parser tests later refactored by newer OpenCode Go work. (role: original feature contributor; confidence: medium; commits: 31bd4812d227; files: Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift, Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageSnapshot.swift, Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift)
  • kiranmagic7: The Zen-balance fallback work changed the same OpenCode Go fetcher, snapshot, and parser-test boundary around subscription usage versus fallback display. (role: recent adjacent contributor; confidence: medium; commits: 6b0a0e504b39; files: Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageFetcher.swift, Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoUsageSnapshot.swift, Tests/CodexBarTests/OpenCodeGoUsageParserTests.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jun 30, 2026
@steipete steipete force-pushed the fix-opencode-go-parsing branch from 6e717f0 to 37bbcb2 Compare July 1, 2026 06:44
@steipete

steipete commented Jul 1, 2026

Copy link
Copy Markdown
Owner

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. label Jul 1, 2026
@steipete steipete force-pushed the fix-opencode-go-parsing branch 3 times, most recently from d3381a0 to ef7196c Compare July 1, 2026 08:54
@steipete

steipete commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Maintainer proof decision: fixture-only evidence is accepted for this bounded parser change; live browser/Keychain probing is intentionally excluded by repository safety policy. Exact-head focused tests, source-blind compiled-artifact validation, make check, and autoreview are green.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 1, 2026
@steipete steipete force-pushed the fix-opencode-go-parsing branch from ef7196c to f4a1879 Compare July 1, 2026 10:23
Co-authored-by: Moe Kanan <mohammedkanan1997@gmail.com>
@steipete steipete force-pushed the fix-opencode-go-parsing branch from f4a1879 to 0045897 Compare July 1, 2026 16:11
@steipete

steipete commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Exact-head proof refreshed after the final rebase onto merged #1692.

  • Head: 0045897835c55ece328222af7d3c2e90d3ad094d
  • Base: 101c178019491d9e9310b3b51a5e0e9b85b359ab
  • swift test --filter OpenCodeGo: 63/63 passed
  • make check: passed; SwiftFormat 0/1208, SwiftLint 0/1207
  • make test: all 44 shards passed
  • Source-blind compiled-artifact parser contract: 27/27 passed
  • ./Scripts/package_app.sh: exact-head release app and widget package passed without launching the app
  • Branch autoreview: clean, zero actionable findings (0.86)

Maintainer acceptance remains fixture-only for this bounded parser repair. No live OpenCode account, browser-cookie import, or Keychain prompt was used.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added the proof: sufficient Contributor real behavior proof is sufficient. label Jul 1, 2026
@steipete steipete merged commit 55a67bb into steipete:main Jul 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants