Skip to content

Send a User-Agent on live audits (fixes GitHub 403)#12

Merged
lex00 merged 1 commit into
mainfrom
fix/github-user-agent
Jun 18, 2026
Merged

Send a User-Agent on live audits (fixes GitHub 403)#12
lex00 merged 1 commit into
mainfrom
fix/github-user-agent

Conversation

@lex00

@lex00 lex00 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Every live /audit returned 400 {"error":"…api.github.com/… returned 403"} — even with GIT_TOKEN set. Root cause: GitHub's API 403s requests with no User-Agent, and workerd's fetch sends none by default. Node's fetch sends a default UA, so the CLI and the fixture-based E2E never hit it.

Wrap the audit fetch (uaFetch) to identify the service to GitHub. Fixture path is unchanged. 3 unit tests. chant core gets a fallback UA in a separate fix so the engine never 403s in UA-less runtimes.

🤖 Generated with Claude Code

GitHub's API rejects requests with no User-Agent (403), and workerd's fetch
sends none by default — so every live audit 403'd regardless of GIT_TOKEN. The
fixture-based E2E never hit the real API, so it slipped through. Wrap the audit
fetch to identify the service to GitHub. chant core gets a fallback UA too
(separate fix) so it never 403s in UA-less runtimes.
@lex00 lex00 merged commit 42ef9c2 into main Jun 18, 2026
4 checks passed
@lex00 lex00 deleted the fix/github-user-agent branch June 18, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant