Repository navigation
gh pr list with flags fails JSON parsing #14394
Description
Activity
Thanks for the detailed repro and debug log! Suggested labels:
bug(medium confidence) andgh-pr(high confidence).Duplicate check: No existing duplicate found for this specific symptom (searched "invalid character after object key", "cache corrupted response", "feature detection cache race").
Analysis: Looking at the debug output, the crash isn't in
gh pr listitself — it happens on the second request, theSearchType_enumValuesGraphQL introspection query used for advanced-search feature detection on GHES, which only runs when filter flags triggershared.FilterOptions/feature detection (explaining why unfilteredgh pr listworks). The response body logged is literally{{"data":...}— a duplicated leading{— which is what producesinvalid character 'd' after object key. That's consistent with a corrupted/malformed byte written to (or read from) the on-disk response cache (api.NewCachedHTTPClient, 24h TTL) used to memoize feature-detection calls, rather than a normal server-side JSON issue, since the HTTP response shown just before it is valid JSON. I can't confirm the exact corruption mechanism (e.g. concurrent read/write on the same cache key, partial write) without deeper reproduction, so a maintainer will likely want to check for cache-file corruption under concurrentghinvocations or interrupted writes to~/.cache/gh-cli/.... If the reporter can share whether the failure is consistent/reproducible on repeat runs, and the output offind ~/.cache/gh-cli -newer <recent-file>or simply retrying after clearing the local gh cache, that would help narrow this down further.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
proxy.golang.org
To allow these domains, add them to the
network.allowedlist in your workflow frontmatter:network: allowed: - defaults - "proxy.golang.org"
See Network Configuration for more information.
Generated by Issue Triage (skills-driven) for #14394 · copilot · auto · 123.1 AIC · ⌖ 2.98 AIC · ⊞ 11.2K · ◷
@yrahul3910 can you try
gh config clear-cacheand thengh pr list --author "@me"again and see whether this reproduces?- addedmore-info-neededMore info needed from user/contributorMore info needed from user/contributor
on Sep 8, 2026 Oh huh, that did work. Thanks! Maybe this was just a one-off thing, so I'll close the issue.
- removedmore-info-neededMore info needed from user/contributorMore info needed from user/contributorneeds-triageneeds to be reviewedneeds to be reviewed
on Sep 8, 2026 It's probably cli/go-gh#252. Gonna re open this to make sure we get it fixed, thanks!
Historically,
ghwas very much a "type things on your terminal" or "run one off automation commands", or even "run many commands sequentially" and less "have many instances running at once (particularly via agents)" so we need to do a better job of making it parallel safe.Reacted by Rahul Yedida- addedbugSomething isn't workingSomething isn't workingpriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
on Sep 9, 2026 For visibility: #263 fixed the write side in go-gh (atomic publish), but entries corrupted before that fix — like the
{{data...body in the debug log above — have valid HTTP framing with a corrupt body, so they are still served from cache and still break callers. Noghrelease can heal those files; onlygh config clear-cachedoes today. I opened cli/go-gh#300 as a follow-up to cli/go-gh#252: it records a SHA-256 digest per entry and evicts entries that fail verification, so corrupt entries are refetched and the cache self-heals.
Describe the bug
When
gh pr listis called with filters such as--author, it seemingly fails to parse JSON:However,
gh pr listwithout the flags works. The surrounding quotes do not change the outcome. This is on a repo in GitHub Enterprise.Affected version
Steps to reproduce the behavior
In a GitHub repo, run
gh pr listwith a filtering flag (any of the examples ingh pr list --helpseem to trigger this).Logs