Repository navigation
Description
The command devops gh api rate_limit --jq '.resources.graphql.remaining' fails. It prints "Invalid rate_limit payload format from GitHub API". A script cannot read one number from the rate limit. The GitHub request budget work needs that number.
Evidence: I reproduced the failure four times on 2026-10-22. The function _extract_rate_limit_endpoint_response in src/devops_cli/github/rate_limiter.py (about lines 1590 to 1610) parses the output that comes after the --jq filter as the whole payload. A filtered number is not a dictionary, so the parse fails.
Remedy: refresh the quota from the unfiltered answer, or skip the refresh when --jq is set. Write a test with a --jq filter over the GitHub session fake.
Existing tool considered: none applies. This is a defect in project code. The GitHub request budget investigation may replace this limiter. Until then the defect blocks scripts.
Acceptance criteria:
devops gh api rate_limit --jq '.resources.graphql.remaining'prints the number.- A test covers the
--jqcase and fails on the base.
Proposed design
Problem statement
The command devops gh api rate_limit --jq '.resources.graphql.remaining' fails with 'Invalid rate_limit payload format from GitHub API' because the rate limiter tries to parse the output of a filtered jq query as a full JSON payload, but a filtered number is not a dictionary.
Acceptance criteria
- Criterion 1:
devops gh api rate_limit --jq '.resources.graphql.remaining'prints the number.
Verification: Run the command and verify it outputs a single integer value representing the remaining GraphQL requests. - Criterion 2: A test covers the
--jqcase and fails on the base.
Verification: Write a unit test that mocks the GitHub session with a--jqfilter and verifies the current behavior fails, then verify it passes after implementing the fix.
Key questions
- What is the exact location in the code where the parsing of rate limit response fails?: The function
_extract_rate_limit_endpoint_responseinsrc/devops_cli/github/rate_limiter.py(around lines 1590 to 1610) parses the output that comes after the--jqfilter as the whole payload. When--jqis used, the result is a filtered number which is not a dictionary, so the parse fails. [sources: src/devops_cli/github/rate_limiter.py:1589] - What is the remedy suggested in the issue description?: Refresh the quota from the unfiltered answer, or skip the refresh when
--jqis set. Write a test with a--jqfilter over the GitHub session fake. (proposed)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 22, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate describes a defect in project code that causes a command to fail.The defect blocks scripts that need to read GitHub request budget information.The failed run 1867 does not set P0: it does not appear in the candidate's text. A person can set P0 on the board.Fixing this allows scripts to correctly read rate limit information from the GitHub API.Requires modifying the rate limiter logic and adding a test with a GitHub session fake.dan-petty commentedon Oct 22, 2026
Status set to Ready at ae8c2d9 (see proposed design in issue body).