Skip to content

fix(vscode)!: launch the Rstest worker under js-debug when debugging - #76

Merged
fi3ework merged 6 commits into
mainfrom
fix-test-debug-launch
Sep 29, 2026
Merged

fi3ework merged 6 commits into
mainfrom
fix-test-debug-launch

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Summary

Debugging a test from Test Explorer spawned the Rstest worker with a bare --inspect-wait and attached with a numeric processId, which js-debug does not resolve, so the attach always went to localhost:9229. When 9229 was already taken (another debug session, a dev server started with --inspect), Node printed address already in use, ran the tests without waiting, and breakpoints never hit.

Debug runs now use js-debug request: 'launch':

  • js-debug starts the worker and auto-attaches Rstest's pool child processes, picking inspector ports itself. The extension no longer handles ports.
  • Existing settings map onto the launch config: nodeExecutable → runtimeExecutable, nodeExecArgs → runtimeArgs, nodeEnv / debugNodeEnv → env, debugExclude → skipFiles, debugOutFiles → outFiles.
  • Because js-debug owns the process, the extension has no IPC channel to it. Debug runs talk to the worker over a local socket (a Unix domain socket in a private 0700 temp dir, or a named pipe on Windows) carrying the same JSON birpc messages. The worker must send a per-launch token as its first line before the connection is accepted. Normal runs keep Node IPC unchanged.

Breaking: rstack.rstest.debuggerPort and rstack.rstest.debuggerAddress are removed. Under launch they have nothing to control.

The divergence from the upstream standalone extension is recorded as adaptation 11 in packages/vscode/AGENTS.md.

Related Links

Checklist

  • Tests updated (or not required). New E2E drives a real debug session with port 9229 occupied: the breakpoint hits at the expected line, and continue / cancel / stop each end the run, all sessions and every worker and pool process. Unit tests cover launch failure, cancellation before the worker connects, disposal during launch, the settings mapping, and socket authentication.
  • Documentation updated (or not required).

Let js-debug own the worker and pool processes, using a debug-only local
socket for JSON RPC while normal runs retain Node IPC. Bound startup and
close the session on cancellation, transport failure, or worker disposal.

Cover real breakpoints with port 9229 occupied and verify process cleanup
after continuing, cancelling, and stopping the debug session.

BREAKING CHANGE: remove rstack.rstest.debuggerPort and
rstack.rstest.debuggerAddress without aliases or migration. js-debug
manages inspector endpoints automatically.

Amp-Thread-ID: T-01a0ec42-b8e2-71ba-b623-05b375f9e885
Remove redundant launch state, listeners, and timeout handling. Share the
debug socket environment key and keep unit coverage focused on behavior
not already exercised by the real debug E2E suite.

Record debugger-owned test processes as an upstream adaptation.

Amp-Thread-ID: T-01a0ec42-b8e2-71ba-b623-05b375f9e885
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T09:54:18.259416Z a1fd3f9 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 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: 25a4296edb

ℹ️ 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".

Comment thread packages/vscode/src/stacks/test/debugWorker.ts
@fi3ework fi3ework changed the title fix(vscode): launch the Rstest worker under js-debug when debugging fix(vscode)!: launch the Rstest worker under js-debug when debugging Sep 29, 2026

@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: 3dbce7d7b5

ℹ️ 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".

Comment thread packages/vscode/src/stacks/test/debugWorker.ts

@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: a1fd3f9e93

ℹ️ 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".

Comment thread packages/vscode/src/stacks/test/worker/index.ts
@fi3ework
fi3ework merged commit f5741b1 into main Sep 29, 2026
3 checks passed
@fi3ework
fi3ework deleted the fix-test-debug-launch branch September 29, 2026 10:48
This was referenced Sep 29, 2026
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