Skip to content

fix(cli): preserve offline seed redirects - #1240

Merged
nc9 merged 1 commit into
squirrelscan:mainfrom
WilliamK112:codex/offline-seed-redirect-1224
Oct 28, 2026
Merged

nc9 merged 1 commit into
squirrelscan:mainfrom
WilliamK112:codex/offline-seed-redirect-1224

Conversation

@WilliamK112

Copy link
Copy Markdown
Contributor

Summary

  • preserve typed RequestError values across the Effect promise boundary in the reachability probe
  • treat offline redirects to sibling hosts or another domain as a reachable seed redirect
  • add deterministic non-localhost coverage for sibling-host and link-shortener URLs
  • document the fix in the unreleased changelog

Closes #1224

Verification

  • bun test ./apps/cli/tests/utils/reachability.test.ts
  • bun test ./apps/cli/tests/utils/reachability-retry.test.ts
  • bun run --filter @squirrelscan/cli typecheck
  • bun run --filter @squirrelscan/cli lint
  • cd apps/cli && node_modules/.bin/oxfmt src/utils/reachability.ts tests/utils/reachability.test.ts --check
  • bash scripts/test-changelog-extraction.sh
  • bun test ./scripts/release-version.test.ts

Checklist

  • I added or updated tests for behavioral changes.
  • I did not include secrets, customer data, or incompatible third-party material.
  • Every commit includes a DCO Signed-off-by line (git commit -s).

Docs: none. Skill: none.

nc9 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Reviewed head: f8164ec

Verdict: looks good. Thanks for this. CI is green, the DCO sign-off is present, there is no new runtime dependency, and the CHANGELOG bullet is under [Unreleased].

Low

  • The root cause reads right: Effect.runPromise wraps failures in a FiberFailure, so the instanceof RequestError branch never matched and the off-site refusal fell through to the generic error path. Moving to Effect.either keeps the typed error. Worth confirming the old catch fallbacks for timeouts and network errors still see the same messages now that RequestError no longer reaches them; the existing reachability and retry tests cover this and pass.
  • The test injects a stub through a new optional requestScoped parameter on checkReachability. That is a reasonable seam, but it widens the exported signature only for tests. Acceptable; no change needed.
  • The test covers the refusal handling but not an end-to-end --offline run against a sibling-host redirect. A fixture for that is a nice-to-have, not a blocker.

@nc9 nc9 added the bug Something isn't working label Oct 28, 2026 — with Claude
@nc9
nc9 merged commit e7ff5fe into squirrelscan:main Oct 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

squirrel audit --offline: a start URL that redirects to a sibling host fails with 'Cannot reach ... refused: host outside the allowed set'

2 participants