Skip to content

fix: check CSMA output for rate limit errors even on exit 0 - #1711

Merged
ralphbean merged 1 commit into
mainfrom
fix/csma-exit-zero-rate-limit
Jun 1, 2026
Merged

fix: check CSMA output for rate limit errors even on exit 0#1711
ralphbean merged 1 commit into
mainfrom
fix/csma-exit-zero-rate-limit

Conversation

@ralphbean

Copy link
Copy Markdown
Member

Summary

  • The gh CLI (notably gh project view) can exit 0 while printing a GraphQL rate limit error to stderr. The CSMA wrapper previously only entered the retry loop on non-zero exit codes, so these errors passed through undetected — downstream jq would fail to parse the error text and set -e would kill the script with no retries.
  • Now all three CSMA runners (github_csma_run, github_csma_run_pipe, github_csma_run_cmd) always inspect combined stdout+stderr for rate limit patterns regardless of exit code.
  • Two new test cases cover the exit-0 rate limit scenario: transient retry and exhausted retries.

Root cause: prioritize run 26447310264 failed because gh project view returned exit 0 with GraphQL: API rate limit exceeded for installation ID 131739396. on stderr. The CSMA wrapper saw exit 0 and returned success. The error text was then piped to jq which couldn't parse it, and set -e killed the script immediately — zero retries.

Test plan

  • New test exit0-rate-limit-retry: gh exits 0 with rate limit error for first 2 calls, then succeeds — verifies CSMA retries and the full script completes
  • New test exit0-rate-limit-exhausted: persistent exit-0 rate limit errors — verifies CSMA exhausts retries and reports the rate limit error on stderr
  • All existing tests still pass (happy-path, rate-limit-retry, auth-error, exhausted-retries)
  • shellcheck clean

🤖 Generated with Claude Code

The gh CLI (notably `gh project view`) can exit 0 while printing a
GraphQL rate limit error to stderr. The CSMA wrapper previously only
entered the retry loop on non-zero exit codes, so these errors passed
through undetected — downstream `jq` would fail to parse the error
text as JSON and `set -e` would kill the script with no retries.

Now all three CSMA runners (github_csma_run, github_csma_run_pipe,
github_csma_run_cmd) always inspect combined stdout+stderr for rate
limit patterns regardless of exit code.

Fixes: https://github.com/fullsend-ai/.fullsend/actions/runs/26447310264

Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ralph Bean <rbean@redhat.com>
@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://0d5f50cf-site.fullsend-ai.workers.dev

Commit: 39335444b65e95442b25e640acecee8870deb711

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

No findings.

@ralphbean
ralphbean added this pull request to the merge queue Jun 1, 2026
Merged via the queue into main with commit 4197cff Jun 1, 2026
12 checks passed
@ralphbean
ralphbean deleted the fix/csma-exit-zero-rate-limit branch June 1, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants