Repository navigation
Bound the OpenCode Go Auto history scan - #5062
harjothkhara wants to merge 2 commits into
Conversation
Auto waits at most 5 seconds for local history before returning authoritative remote quota without history. The scan keeps running to warm the reader cache for a later refresh; partial history is never published. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the bounded Auto scan times out and no API key, browser session, or CLI login yields authoritative quota, wait for the same scan and return the local estimate as before instead of failing. The wait stays cancellable and never cancels the scan itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR limits Auto’s initial local-history wait to five seconds before trying authoritative remote quota, while preserving local-only fallback. Example: A 488 MB OpenCode database takes 30 seconds to scan, while the CLI login can return quota in under one second.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a current cold-scan delay and contains no definite introduced defect found in review; the bounded wait and omission of slow history need an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe OpenCode Go provider receives source and account settings, combines SQLite cost history with authenticated quota sources, and returns usage snapshots to the app and CLI. flowchart TD
A[App or CLI refresh] --> B[OpenCode Go Auto strategy]
B --> C[Local SQLite scan]
C --> D[Bounded history join]
D --> E[Existing remote quota sources]
E --> F[Usage snapshot]
E --> G[Await same scan without quota]
G --> F
Technical reviewBest possible solution: Keep the existing provider and cache owners, bound only Auto’s history join, and preserve authoritative quota precedence and complete local fallback. Do we have a high-confidence way to reproduce the issue? Current-main source serializes the full SQLite history read before quota overlays, matching the linked v0.84.0 report and its SQLite I/O trace; no target code was run during this read-only review. Is this the best way to solve the issue? The patch addresses the blocking dependency in the existing strategy and reuses the shared join helper while retaining account-selection guards and local fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7447bc77c249. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 11, 2026, 12:41 PM ET / 17:41 UTC. |
Fixes #5060.
In Auto, OpenCode Go finished the whole local
opencode.dbscan before asking for remote quota, so a cold run on a large or slow database blocked for tens of seconds. Auto now joins the local scan for at most 5 s, using the existingBoundedTaskJoin.web,apiandclisources are unchanged.Tests:
OpenCodeGoAutoScanBudgetTestscovers a slow scan with remote quota (prompt return), a slow scan without remote quota (local result) and a small database (unchanged). I ran it and the existing OpenCode Go suites (94 tests) in a Core-only target, plus mutation checks, because the full test target needs Xcode here.make checkpasses.Release
CodexBarCLI,usage --provider opencodego --source auto --format json, synthetic database in a scratch home with network and Keychain denied:🤖 Generated with Claude Code