fix: surface rate limit errors with recovery options#505
Merged
bradygaster merged 1 commit intodevfrom Mar 22, 2026
Merged
Conversation
- Add rateLimitGuidance() and extractRetryAfter() to error-messages.ts - Detect rate limit errors (instanceof RateLimitError or message pattern) in handleDispatch catch block instead of falling through to generic message - Show actionable recovery: retry time, squad economy on, model override - Write .squad/rate-limit-status.json on detection for squad doctor to read - Add checkRateLimitStatus() to squad doctor — warns on recent rate limits, passes when stale (>4h), silent when no rate limit has been hit - 36 new tests covering rateLimitGuidance, extractRetryAfter, and doctor check Closes #464 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3365c69 to
4fc5b08
Compare
chrislomonico
pushed a commit
to clomonico/squad
that referenced
this pull request
Mar 26, 2026
Wires upstream command into CLI entry point. Closes bradygaster#505 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #464 -- Squad CLI was showing generic 'Something went wrong processing your message' instead of the actual Copilot rate limit info, and squad doctor reported nothing useful.
Working as EECOM (Core Dev)
What Changed
Rate limit detection in the shell
New error-messages.ts exports
squad doctor improvement
Recovery options offered to users
When a rate limit is hit, users see:
Rate limit reached for claude-sonnet-4.5. Copilot has temporarily throttled your requests.
Try again in 2 hours
Enable economy mode to switch to cheaper models: squad economy on
Or set a different model: add defaultModel to .squad/config.json
Tests