Skip to content

test(inspector): spell Node discovery targets as Node reports them - #10663

Merged
morluto merged 5 commits into
morluto:mainfrom
Davmunrey:claude/ecstatic-mendel-v9t4al
Nov 18, 2026
Merged

morluto merged 5 commits into
morluto:mainfrom
Davmunrey:claude/ecstatic-mendel-v9t4al

Conversation

@Davmunrey

@Davmunrey Davmunrey commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #9996. 583bb47 and f35b6a7 already fixed the underscore case. On main, a space or % in TMPDIR still fails the Inspector cancellation test and includes targets outside the old caller root filter.

Problem and expected behavior

The fake V8 Inspector reported Node-type targets as pathToFileURL(path).href, which is a percent-encoded WHATWG URL. Node's /json/list reports file:// followed by the raw pathname, with " and \ replaced by _. authorizeRuntimeTargetLocation reads that value literally, so /tmp/space%20root/… points to a path that does not exist. The target stays unresolved, and the tests fail on unrelated assertions.

Change and scope

  • tests/fixtures/inspector/fakeV8Inspector.ts adds nodeDiscoveryTargetUrl(path), which spells target URLs the way Node does.
  • The two cases that assert a resolved Node target location now use it.
  • The underscore case still relies on createNodeDiscoveryTempDirectory. This is a test-only change.

Evidence and regression coverage

  • On base 1ba93b4, with TMPDIR containing a space or %, the cancellation test fails 1 of 5 in each case. With _ it already passes.
  • On this branch, 69 inspector/browser/MCP/acceptance files pass 1168/1168 with no skips under each of bad_root, space root, pct%root and goodroot.
  • Gap: Windows was not run. On Windows, Node discovery paths are never verified.

Validation performed

  • npm run test:focused -- <69 files> under 4 TMPDIR spellings: all 1168 tests passed.
  • npm run check:fast: passed.

Author readiness

Human owner: @Davmunrey

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merging

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

The fake V8 Inspector gave Node-type targets a percent-encoded WHATWG file
URL, while Node's /json/list reports `file://` plus the raw pathname with
quotes and backslashes replaced by underscores. The product reads that
channel literally, so a TMPDIR containing a space or percent sign named a
pathname that did not exist and the target stayed unresolved: the
Inspector cancellation test and "includes targets outside the old caller
root filter" failed on unrelated assertions.

Add nodeDiscoveryTargetUrl to the fake and use it where a resolved Node
target location is asserted. The underscore case stays with
createNodeDiscoveryTempDirectory.

Validation: 69 inspector/browser/MCP/acceptance test files, 1168/1168
passing under TMPDIR spellings with an underscore, a space, a percent sign
and none; check:fast passes.

Refs morluto#9996
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T12:03:20.110776Z 2631891 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only PR appears safe to merge; no new blocking issues were found.

Summary

This test-only change makes fake Node Inspector targets use Node’s raw path spelling and adds explicit special-character coverage.

  • Inspector tests now spell Node target paths the way Node reports them.

Reviews (7) · Last reviewed commit: "Merge main into the Node discovery spell..." · Reviewed by Greptile

@Davmunrey

Copy link
Copy Markdown
Contributor Author

@codex review

@Davmunrey Davmunrey left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: b514fa4e08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Review follow-up for Node discovery target URLs.

Neither caller gave nodeDiscoveryTargetUrl an explicit special-character
path, so spaces and percent signs were exercised only when TMPDIR
happened to contain them. A boundary case now lists two targets in one
discovery root. "with space %41.js" is reported literally and resolves
to its file. 'with "quote".js' is reported with underscores and stays
an unresolved, unverifiable file location.

Tests: tests/boundary/inspector/javascriptRuntimeObservation.test.ts
passes (31).
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@Davmunrey Davmunrey left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Status since opening:

  • Greptile's request for explicit special-character coverage is addressed in ca43163:
    • with space %41.js resolves to its file;
    • with "quote".js stays an unresolved, unverifiable location.
  • javascriptRuntimeObservation boundary tests pass (31). Format and static checks pass with the branch merged into current main.
  • This replaces #10622, closed after its readiness declaration failed.

@Davmunrey

Copy link
Copy Markdown
Contributor Author

Ready to merge: full CI is green on this head, Greptile's latest review is 5/5 with no open threads, and it merges into main 42cab26 without conflicts.

main consolidated the Inspector coverage and removed the test for
targets outside the old caller root filter, which this branch had
edited. Follow that removal and keep the test this branch adds for
discovery paths with spaces, percent signs and quotes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5d31dc2c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…s it

main folded the test this branch had respelled into "lists all
connectable targets on the selected endpoint across directories", which
still built its two discovery targets with pathToFileURL. Under a
temporary directory with a space or a percent sign those targets came
back unresolved and the file-location assertions failed.

Build them with nodeDiscoveryTargetUrl, as the rest of this branch does.
main replaced the fixture's additionalTargetUrl option with additionalTargets. The three
call sites here pass the Node-reported spelling through the new option.
@morluto
morluto merged commit 93bf4df into morluto:main Nov 18, 2026
41 checks passed
Davmunrey added a commit to Davmunrey/Davmunrey that referenced this pull request Nov 18, 2026
@morluto morluto added the area: tests Test suite and verification label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Inspector cancellation test fails when TMPDIR contains an underscore

2 participants