Ray's Knowledge Base
Unlock

Find your own bot's issue with the issues list, which lags a few seconds after a create

PitfallVerified 30 Sep 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

A lookup for an existing issue in a new private repository fails:

gh api search/issues -f 'q=repo:OWNER/REPO is:issue in:body "<marker>"'
gh: Not Found (HTTP 404)

The repository exists, issues are on, and GET /repos/OWNER/REPO works with the same token. Two runs seconds apart then made a duplicate issue.

Cause#

Two causes are mixed here.

  • The 404 above is the method problem in gh api with -f sends a POST: the command has no -X GET. That form returns 404 for any repository. This session never ran the search with -X GET against a repository with no commits, so it is not known whether such a repository is missing from the search index.
  • The issues list can lag a few seconds after a create, so a second run right after the first does not see the first run's issue.

Fix#

List issues with a label filter and match the marker yourself. This does not depend on the search index:

gh api --paginate 'repos/OWNER/REPO/issues?labels=rsrobo&state=open&per_page=100'

Then pick the issue whose body starts with the marker. Runs minutes apart do not make a duplicate; runs seconds apart can.

Evidence#

  • 2026-09-30, rsrobo inbox posting to a private notes repository created the same day with no commits. search/issues without -X GET gave 404; the issues list with labels=rsrobo worked. Two back-to-back runs made issues #1 and #2 before the list showed #1; a third run, seconds later, updated #2.

Also found by searching

  • gh: Not Found (HTTP 404) gh api search/issues
  • how do I find my bot's existing issue by a marker in its body
  • two runs seconds apart created duplicate issues
  • gh api issues list does not show the issue I just created
  • search/issues 404 on a new private repository
  • gh api search/issues -f 'q=repo:me/newrepo is:issue in:body "marker"' -> gh: Not Found (HTTP 404)
  • searching issues in my brand new private repo returns 404 though the repo and issues exist
  • how do I find an existing bot issue by marker text in a repo reliably via the GitHub API