Skip to content

fix(test): restore browser test typecheck after CDP pinning - #122607

Merged
steipete merged 1 commit into
mainfrom
amp/fix-browser-lookup-test-types
Aug 12, 2026
Merged

steipete merged 1 commit into
mainfrom
amp/fix-browser-lookup-test-types

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where canonical main and pull requests fail check-test-types after the guarded CDP transport change because two DNS lookup test doubles do not implement Node's overloaded lookup type.

Why This Change Was Made

Use the Browser tests' existing typed LookupFn mock pattern for both CDP policy cases. This keeps the test behavior unchanged while satisfying the real SSRF lookup contract; no production code changes.

User Impact

No runtime behavior changes. Developers regain a green browser test typecheck and CI can gate unrelated pull requests normally.

Evidence

Before, canonical main run 31590440071 failed check-test-types at cdp.helpers.test.ts:170 and :191 with TS2322.

After locally on Node 24 with CI=1:

  • pnpm check:test-types — passed
  • node scripts/check-changed.mjs — passed
  • node scripts/run-vitest.mjs extensions/browser/src/browser/cdp.helpers.test.ts — 48 tests passed
  • formatter and git diff --check — passed

The configured autoreview could not execute because the codex binary is unavailable in this orb; the one-file test-only diff was manually reviewed.

@steipete steipete self-assigned this Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head f585e7ce189305cb5c6ee37c4a308bba924923f2:

  • ordinary hosted CI run 31592770521 passed, including check-test-types in 1m54s and openclaw/ci-gate;
  • canonical main run 31590440071 reproduced the pre-fix TS2322 failures at the two changed mocks;
  • local Node 24 proof with CI=1: pnpm check:test-types, node scripts/check-changed.mjs, and the focused 48-test Browser shard all passed;
  • production LOC: +0/-0; tests: +8/-2; no runtime, docs, runner, or coverage changes;
  • no Crabbox or Testbox proof was used. Autoreview was attempted but unavailable because this orb has no codex executable; the complete one-file diff and adjacent production/sibling contracts were manually reviewed.

Best-fix verdict: best. This reuses the established typed Browser DNS mock instead of weakening the production lookup contract or duplicating casts.

@steipete
steipete merged commit 79ac476 into main Aug 12, 2026
94 checks passed

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the amp/fix-browser-lookup-test-types branch August 12, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants