Skip to content

Port the debugger into main#601

Merged
rentziass merged 17 commits into
mainfrom
debugger
Jun 10, 2026
Merged

Port the debugger into main#601
rentziass merged 17 commits into
mainfrom
debugger

Conversation

@rentziass

@rentziass rentziass commented Jun 10, 2026

Copy link
Copy Markdown
Member

This bring the debugger capability from the debugger branch into main, gated behind the github-actions.debugger.enabled user setting.

Copilot AI and others added 17 commits April 8, 2026 08:32
Add debugger build workflow and README install instructions
This is the first step toward bringing the Actions job debugging
experience into VS Code. The full vision is described in the ADR
(c2c-actions/docs/adrs/9758-actions-job-debugger-mvp.md): users will be
able to re-run a job with a debugger attached and connect their editor
to inspect variables, evaluate expressions, and run commands in the
job's runtime context — all through the standard Debug Adapter Protocol.

This PR adds the extension-side connect flow:

- A new command ('GitHub Actions: Connect to Actions Job Debugger...')
  that prompts for a Dev Tunnel wss:// URL and starts a debug session.
- A WebSocket-based inline debug adapter (DebugAdapterInlineImplementation)
  that speaks DAP-over-WebSocket directly to the runner — no local TCP
  bridge needed.
- Authentication using the existing VS Code GitHub session token, sent
  as a Bearer token on the WebSocket handshake.

The tunnel URL is entered manually for now. Once the server-side
endpoint that serves the debugger URL for a job is deployed, we can
automate this (and eventually add 're-run with debugger' directly from
the extension).

Security hardening:
- Tunnel URLs restricted to wss://*.devtunnels.ms only.
- Auth tokens kept in extension-private memory with cryptographic
  nonces, never exposed through DebugConfiguration.
- Tunnel URL re-validated in the adapter factory (defense in depth).
- 30s connection timeout prevents indefinite hangs.
- WebSocket send/ping errors trigger clean session teardown.
- Debugger registration gated to Desktop VS Code (Node context).

Workarounds for VS Code quirks (to be removed as the runner evolves):
- Synthetic source references on stack frames so VS Code auto-focuses
  the top frame and loads variables on connect/step.
- Buffering of early 'stopped' events that the runner sends before
  VS Code completes the DAP handshake.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 'Connect to Actions Job Debugger' command
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 10, 2026 13:43
@rentziass rentziass requested a review from a team as a code owner June 10, 2026 13:43

Copilot AI 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.

Pull request overview

Ports the GitHub Actions “job debugger” functionality from the debugger branch into main, gated behind the github-actions.debugger.enabled setting and Desktop VS Code, by adding a custom debug type that connects to a runner bridge over a WebSocket DAP transport.

Changes:

  • Adds a new debug type (github-actions-job) with a “Debug Running Job…” command and activation events.
  • Implements the debugger connect flow (job URL parsing, API call to fetch tunnel URL, token nonce handling) and a DAP-over-WebSocket inline debug adapter.
  • Adds configuration handling for the preview setting (including a reload prompt) plus URL validation utilities with unit tests.
Show a summary per file
File Description
src/extension.ts Wires debugger registration/guard into extension activation (Desktop + setting gated).
src/debugger/debugger.ts Implements command + debug type plumbing (configuration provider, adapter factory/tracker, connect flow).
src/debugger/webSocketDapAdapter.ts Inline debug adapter that transports DAP JSON messages over a WebSocket.
src/debugger/tunnelUrl.ts Validates returned tunnel URLs against a strict allowlist.
src/debugger/tunnelUrl.test.ts Unit tests for tunnel URL validation.
src/debugger/jobUrl.ts Parses/validates GitHub Actions job URLs and derives expected host from API URI.
src/debugger/jobUrl.test.ts Unit tests for job URL parsing/host mapping.
src/configuration/configuration.ts Adds isDebuggerEnabled() and prompts reload when the setting toggles (Desktop only).
package.json Declares debug type + command and adds ws dependency.
package-lock.json Locks ws / @types/ws additions.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 9/10 changed files
  • Comments generated: 4

Comment thread src/debugger/debugger.ts
Comment thread src/debugger/debugger.ts
Comment thread src/debugger/debugger.ts
Comment thread src/debugger/webSocketDapAdapter.ts
@rentziass rentziass merged commit 7dc3149 into main Jun 10, 2026
6 checks passed
@rentziass rentziass deleted the debugger branch June 10, 2026 15:19
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.

4 participants