Commit 96317f9
fix(hackbrowser): guard CYBERSTRIKE_VERSION in the worker's Copilot fetch — fixes Copilot crawls
The Copilot request path in the hackbrowser worker subprocess set its User-Agent with a bare
`CYBERSTRIKE_VERSION` — a build-time define that the standalone worker bundle build never
injects. In the subprocess that identifier is undefined, so the header line threw
`ReferenceError: CYBERSTRIKE_VERSION is not defined` on every planner LLM call, before the
fetch even ran; planPage then returned an empty plan for every page and the crawl "completed"
immediately with no exploration. Only surfaces when a GitHub Copilot model is used — other
providers never enter this branch.
Guard it exactly like Installation.VERSION already does (installation/index.ts):
`typeof CYBERSTRIKE_VERSION === "string" ? CYBERSTRIKE_VERSION : "local"`, so it falls back to
"local" instead of throwing. The main-process chat path uses this same guarded accessor, so the
worker now matches it. No token-exchange/header changes are needed: chat and worker both
authenticate with the raw token and equivalent headers, and chat works — aligning the
User-Agent is sufficient.
Verified: the bare reference throws ReferenceError; the guarded form returns "cyberstrike/local"
with no throw; cyberstrike typecheck clean.
Related: #107.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent a8cd743 commit 96317f9
1 file changed
Lines changed: 6 additions & 1 deletion
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 | | |
174 | 179 | | |
175 | 180 | | |
| |||
0 commit comments