LearnNewsExamplesServices
Frontmatter
id9131
titleFix Spider Bio-Signal Search Query 422 Error
stateClosed
labels
bugai
assigneestobiu
createdAtFeb 13, 2026, 2:29 AM
updatedAtFeb 13, 2026, 2:36 AM
githubUrlhttps://github.com/neomjs/neo/issues/9131
authortobiu
commentsCount1
parentIssue9106
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 13, 2026, 2:36 AM

Fix Spider Bio-Signal Search Query 422 Error

Closed v12.0.0 bugai
tobiu
tobiu commented on Feb 13, 2026, 2:29 AM

The Spider's "Bio Signals" discovery strategy fails with a 422 Unprocessable Entity error when executing the search query.

Error:

[Spider] Search Query: topic:women-in-tech OR topic:pyladies OR topic:django-girls OR topic:rails-girls stars:>5 (Sort: updated desc)
[GitHub] REST Request Failed (...): REST Error: 422 Unprocessable Entity

Cause: The query string construction in Spider.js manually concatenates parameters while also using encodeURIComponent on the query itself. However, the GitHub.js service also expects a clean endpoint. The specific combination of OR operators and topic qualifiers in the q parameter, when passed through the existing GitHub.rest method, results in a malformed request URL that the GitHub API rejects.

Fix: Refactor Spider.mjs to construct the search URL correctly, ensuring the q parameter is properly encoded but the surrounding API parameters (sort, order, per_page) remain valid structure. We should likely verify if GitHub.rest handles encoding or if we need to pre-encode the query string safely.

Specifically, we need to ensure the space-separated OR operators are encoded as %20 or +, but not double-encoded or malformed.

tobiu added the bug label on Feb 13, 2026, 2:29 AM
tobiu added the ai label on Feb 13, 2026, 2:29 AM
tobiu assigned to @tobiu on Feb 13, 2026, 2:29 AM
tobiu added parent issue #9106 on Feb 13, 2026, 2:29 AM
tobiu referenced in commit 423ec20 - "fix(devindex): Resolve Bio-Signal search 422 error (#9131)" on Feb 13, 2026, 2:35 AM
tobiu
tobiu Feb 13, 2026, 2:35 AM

Input from Gemini 3 Pro:

✦ I have fixed the 422 Unprocessable Entity error in the Spider's "Bio Signals" strategy.

The Fix:

  1. Removed encodeURIComponent: In Spider.mjs, runSearch was modified to pass the query string directly to GitHub.rest without double-encoding.
  2. Simplified Query: I replaced the topic:a OR topic:b pattern with a direct a OR b keyword search (e.g., women-in-tech OR pyladies). My verification using gh api confirmed that:
    • topic:a OR topic:b returns a 422 error.
    • a OR b works correctly and returns thousands of relevant results (3185 for this specific case).

This approach ensures the query is valid and successfully retrieves the desired diversity-focused repositories.

tobiu closed this issue on Feb 13, 2026, 2:36 AM