Skip to content

Fix slow Claude CLI failure refreshes#1899

Merged
steipete merged 2 commits into
mainfrom
codex/claude-fast-failure-preflight
Jul 4, 2026
Merged

Fix slow Claude CLI failure refreshes#1899
steipete merged 2 commits into
mainfrom
codex/claude-fast-failure-preflight

Conversation

@steipete

@steipete steipete commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • stop the Claude CLI probe before /status when /usage already returned a terminal error or loading stall
  • preserve /status identity enrichment for successful usage snapshots
  • stabilize the new cost-window test around local calendar days
  • document the Claude refresh improvement in the changelog

Proof

  • swift test --filter TTYIntegrationTests
  • swift test --filter MenuCardCostComparisonTests
  • swift test --filter StatusProbeTests
  • swift test --filter ClaudeCLITimeoutRetryTests
  • make check
  • make test — 47/47 shards passed
  • autoreview — no actionable findings

Live Claude CLI failure timings improved from 19.22s / 7.68s / 19.43s to 7.77s / 7.33s / 8.04s, removing the redundant interactive identity round trip. The freshly packaged app also completed authenticated Claude Web fetches successfully and rendered session, weekly, daily, and extra-usage windows in the menu.

@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 2:20 PM ET / 18:20 UTC.

Summary
This PR adds a pre-/status validation step for Claude CLI /usage terminal errors/loading stalls, updates focused TTY and cost-window tests, and adds a changelog note.

Reproducibility: yes. from source inspection, though I did not execute tests in this read-only review. Current main captures /status before parsing /usage, and the PR's TTY fixture demonstrates the subscription-notice path that should stop before /status.

Review metrics: none identified.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
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.

Next step before merge

  • No ClawSweeper repair lane is needed; this owner-authored PR has no actionable patch findings and should proceed through normal maintainer merge/check handling.

Security
Cleared: The diff does not change dependencies, secrets handling, CI, release scripts, network permissions, or supply-chain execution paths.

Review details

Best possible solution:

Land the small provider fix after normal required checks, keeping the pre-status validation and focused TTY regression coverage.

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

Yes from source inspection, though I did not execute tests in this read-only review. Current main captures /status before parsing /usage, and the PR's TTY fixture demonstrates the subscription-notice path that should stop before /status.

Is this the best way to solve the issue?

Yes. Moving the existing usage-error/loading-stall checks before /status is the narrow maintainable fix and preserves identity enrichment for successful snapshots.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8b417a066cb1.

Label changes

Label changes:

  • add P2: The PR fixes a real Claude-provider refresh latency issue with limited blast radius and focused tests.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes focused test commands plus live Claude CLI timing output and freshly packaged app validation for the changed behavior.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes focused test commands plus live Claude CLI timing output and freshly packaged app validation for the changed behavior.

Label justifications:

  • P2: The PR fixes a real Claude-provider refresh latency issue with limited blast radius and focused tests.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes focused test commands plus live Claude CLI timing output and freshly packaged app validation for the changed behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes focused test commands plus live Claude CLI timing output and freshly packaged app validation for the changed behavior.
Evidence reviewed

What I checked:

Likely related people:

  • steipete: Current blame and recent history show Peter Steinberger owning the current ClaudeStatusProbe fetch/error path and this focused PR's commits. (role: recent area contributor; confidence: high; commits: f84a171bca1b, 27f99eb7f22c, 258f08e2e1b3; files: Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift, Sources/CodexBarCore/Providers/Claude/ClaudeUsageFetcher.swift)
  • Yuxin-Qiao: Commit history ties this person to Claude CLI subscription usage output handling, which is one terminal failure path affected by this PR. (role: adjacent feature contributor; confidence: medium; commits: 126dc9238715; files: Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift, Tests/CodexBarTests/StatusProbeTests.swift)
  • rohitjavvadi: Commit history ties this person to Claude usage loading stall handling, the other terminal condition moved before /status by this PR. (role: adjacent feature contributor; confidence: medium; commits: 354e0b6dd19e; files: Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift, Tests/CodexBarTests/StatusProbeTests.swift)
  • ratulsarna: Commit history ties this person to earlier Claude PTY/session handling that this probe path still uses. (role: adjacent owner; confidence: medium; commits: a86e240ee9e7; files: Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift, Sources/CodexBarCore/Providers/Claude/ClaudeCLISession.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 proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. labels Jul 4, 2026
@steipete steipete merged commit cfd747f into main Jul 4, 2026
9 checks passed
@steipete steipete deleted the codex/claude-fast-failure-preflight branch July 4, 2026 18:40
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: 🦞 diamond lobster Very strong PR readiness with only minor 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.

1 participant