Repository navigation
Conversation
A plan without a five-hour window draws no "Current session" row, so the capture never saw its stop condition and waited out the full 20 s timeout, pressing Enter into the open panel every 0.8 s meanwhile. The capture now ends once the first quota row has its value, the session row or the weekly row, which also stops the Enter retries. Refs steipete#5066
|
🦞👀 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 changesRecognize weekly quota values when Claude omits the session row, allowing capture to finish and stopping repeated Enter presses. Example: Claude displays no Current session row and shows Current week at 55% used.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a current weekly-only Claude capture bug with a focused change; no introduced correctness or security defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Claude provider launches the Claude CLI through a shared PTY session, renders its terminal output, detects quota readiness, and parses the captured panel into usage windows. flowchart LR
A[Usage request] --> B[Claude status probe]
B --> C[Shared PTY session]
C --> D[Claude CLI usage panel]
D --> E[Rendered terminal frame]
E --> F[Quota completion check]
F --> G[Parsed usage windows]
Technical reviewBest possible solution: Extend the existing shared quota predicate to weekly-only panels while retaining refresh, insights, and deadline safeguards. Do we have a high-confidence way to reproduce the issue? Main's session-only predicate cannot accept the reported weekly-only panel, and the capture loop consequently retains its deadline and Enter retries; no tests or live probes were run during this read-only review. Is this the best way to solve the issue? This repairs the existing recognition owner directly without adding state or another capture path, and keeps the separate serve caching proposal outside scope. 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
LabelsLabel changes:
Label justifications:
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 12, 2026, 8:46 AM ET / 13:46 UTC. |
Fixes #5066.
On a plan without a five-hour window,
/usagedraws no "Current session" row. The capture's stop condition only accepted a session value, soClaudeCLISession.captureExclusivewaited out its 20 s deadline and kept sending Enter into the open panel every 0.8 s, although parsing already handles these panels (#4914).usageCaptureHasSessionValue(_:)becomesusageCaptureHasQuotaValue(_:): the first quota label, "Current session" or else "Current week", followed by a percentage before the usage-insights section. A panel with a session row behaves as before, since that label comes first.ClaudeCLISessionuses it forusagePanelOpen, so the Enter retries also stop once the weekly quota is drawn.Refreshing…guard and the insights cut-off are unchanged.isUsageStillLoadinguses the same helper.docs/claude.mdand the unreleased changelog are updated.Tests
ClaudeCLIScreenProbeTests: a weekly-only panel completes the capture, a weekly label still loading does not, and the parsed snapshot keeps the session absent with the weekly and scoped rows.TTYIntegrationTests: a fakeclaudedraws a weekly-only panel. The probe returns the weekly quota and sends no Enter after the panel is drawn.make test-fast FILTER='Claude(CLI|StatusProbe|WeeklyOnly|DirectUsage|UsageInsights|Resilience|Incomplete)|StatusProbeTests|TTYIntegrationTests': 418 tests in 30 suites passed.Sources/change reverted, exactly the two new tests fail (usageCaptureIsCompletefalse for the weekly-only panel; the fake CLI logs Enter presses until the timeout). The other 12 tests in those suites pass.make check: passed, SwiftLint 0 violations.Live
codexbar usage --provider claude --source cli --format jsonon a weekly-only plan (Claude Code 2.1.322, macOS 27.2.1), two runs each,CODEXBAR_DISABLE_KEYCHAIN_ACCESS=1:/usagecaptureBoth return the same windows:
primarynull, weekly and Fable present, no error. Most of the remaining time is startup and the/statuscapture.The
servecaching question in #5066 is not part of this PR.