fix(watch): detect rate-limit errors instead of reporting Board is clear#893
fix(watch): detect rate-limit errors instead of reporting Board is clear#893tamirdresher merged 2 commits intodevfrom
Conversation
🟡 Impact Analysis — PR #893Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (1 file)
squad-cli (1 file)
tests (1 file)
|
There was a problem hiding this comment.
Pull request overview
Fixes misleading squad watch output by distinguishing successful board scans from GitHub API rate-limit / scan failures, and reporting a warning instead of “Board is clear”.
Changes:
- Introduces
RunCheckResult/RunCheckStatusand classifiesrunCheck()failures viaisRateLimitError() - Updates
reportBoard()and the watch round flow to short-circuit phases on failed scans and print rate-limit/error warnings - Adds vitest coverage for rate-limit/error messaging behavior and includes a patch changeset
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
packages/squad-cli/src/cli/commands/watch/index.ts |
Adds scan status plumbing, warning output, and short-circuit behavior on failed scans |
test/watch-rate-limit.test.ts |
New tests validating warning output and notifyLevel bypass behavior |
.changeset/watch-rate-limit-detection.md |
Patch changeset describing the user-facing fix |
d191504 to
24710fb
Compare
|
Is this introducing issues that 916 is meant to fix? |
24710fb to
dd73254
Compare
dd73254 to
fed9d48
Compare
🔍 Squad Review — Kaylee (Engineering)
Verdict: ✅ Ready to merge Review by Squad AI team (Kaylee — Engineering) · requested by Dina Berry |
|
Review findings for PR #893 P1 required: P2 suggestion: The core P2 suggestion: Circuit-breaker failure counter doesn't increment on generic P2 suggestion: Nit: Test file in |
…t strings Remove broad 403 match that misclassified auth errors as rate limits. A bare 403 Forbidden (e.g. insufficient token scopes) is a permanent auth error, not a transient rate limit. Now only matches 429 status codes and explicit rate-limit message strings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ CI validation passed on fork: diberry#143 — 7/7 checks green |
…ear (#893) * fix(watch): detect rate-limit errors * fix(watch): narrow rate-limit detection to 429 and explicit rate-limit strings Remove broad 403 match that misclassified auth errors as rate limits. A bare 403 Forbidden (e.g. insufficient token scopes) is a permanent auth error, not a transient rate limit. Now only matches 429 status codes and explicit rate-limit message strings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Dina Berry <diberry@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
When
squad watchhits a GitHub API rate limit,runCheck()catches the error and returns an empty board state. The watch loop then prints "Board is clear - Ralph is idling" - which is misleading because the board isn't clear, the API just couldn't be reached.Changes
packages/squad-cli/src/cli/commands/watch/index.tsRunCheckStatusdiscriminated union ('ok' | 'rate-limited' | 'error') andRunCheckResultinterfacerunCheck()now returnsRunCheckResultwith status, usingisRateLimitError()to classify failuresreportBoard()accepts optionalscanStatus- shows rate-limit or error warning instead of "Board is clear" on failed scansnotifyLevelsuppression (always visible)test/watch-rate-limit.test.ts(new)8 tests covering rate-limit warning, error warning, normal behavior, notifyLevel bypass, and busy-board fallthrough.
.changeset/watch-rate-limit-detection.mdPatch changeset for
@bradygaster/squad-cli.Closes #806