Skip to content

Commit 446d6cf

Browse files
authored
Merge branch 'main' into digitarald/switch-agent-confirmation
2 parents fe844c0 + 7b92a88 commit 446d6cf

599 files changed

Lines changed: 44784 additions & 48125 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.

.agents/skills/launch/SKILL.md

Lines changed: 84 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,39 @@ Automate VS Code Insiders with the Copilot Chat extension using agent-browser. V
2525
5. **Interact** using element refs
2626
6. **Re-snapshot** after navigation or state changes
2727

28+
> **📸 Take screenshots for a paper trail.** Use `agent-browser screenshot <path>` at key moments — after launch, before/after interactions, and when something goes wrong. Screenshots provide visual proof of what the UI looked like and are invaluable for debugging failures or documenting what was accomplished.
29+
>
30+
> Save screenshots inside `.vscode-ext-debug/screenshots/` (gitignored) using a timestamped subfolder so each run is isolated and nothing gets overwritten:
31+
>
32+
> ```bash
33+
> # Create a timestamped folder for this run's screenshots
34+
> SCREENSHOT_DIR=".vscode-ext-debug/screenshots/$(date +%Y-%m-%dT%H-%M-%S)"
35+
> mkdir -p "$SCREENSHOT_DIR"
36+
>
37+
> # Windows (PowerShell):
38+
> # $screenshotDir = ".vscode-ext-debug\screenshots\$(Get-Date -Format 'yyyy-MM-ddTHH-mm-ss')"
39+
> # New-Item -ItemType Directory -Force -Path $screenshotDir
40+
>
41+
> # Save a screenshot (path is a positional argument — use ./ or absolute paths)
42+
> # Bare filenames without ./ may be misinterpreted as CSS selectors
43+
> agent-browser screenshot "$SCREENSHOT_DIR/after-launch.png"
44+
> ```
45+
2846
```bash
2947
# Build and launch with the extension
3048
npm run compile
31-
# Use a PERSISTENT user-data-dir so auth state is preserved across sessions
32-
code-insiders --extensionDevelopmentPath="$PWD" --remote-debugging-port=9223 --user-data-dir=~/.vscode-ext-debug
33-
# On Windows:
34-
# code-insiders --extensionDevelopmentPath="%CD%" --remote-debugging-port=9223 --user-data-dir=%APPDATA%\vscode-ext-debug
49+
# Use a PERSISTENT user-data-dir so auth state is preserved across sessions.
50+
# .vscode-ext-debug is relative to the project root — works in worktrees and is gitignored.
51+
code-insiders --extensionDevelopmentPath="$PWD" --remote-debugging-port=9223 --user-data-dir="$PWD/.vscode-ext-debug"
52+
# On Windows (PowerShell):
53+
# code-insiders --extensionDevelopmentPath="$PWD" --remote-debugging-port=9223 --user-data-dir="$PWD\.vscode-ext-debug"
3554
3655
# Wait for VS Code to start, retry until connected
3756
for i in 1 2 3 4 5; do agent-browser connect 9223 2>/dev/null && break || sleep 3; done
57+
58+
# Verify you're connected to the right target (not about:blank)
59+
# If `tab` shows the wrong target, run `agent-browser close` and reconnect
60+
agent-browser tab
3861
agent-browser snapshot -i
3962
```
4063
@@ -77,27 +100,66 @@ To debug a VS Code extension via agent-browser, launch VS Code Insiders with `--
77100
npm run compile
78101

79102
# Launch VS Code Insiders with the extension and CDP
80-
# IMPORTANT: Use a persistent directory (not /tmp) so auth state is preserved
103+
# IMPORTANT: Use a persistent directory (not /tmp) so auth state is preserved.
104+
# .vscode-ext-debug is relative to the project root — works in worktrees and is gitignored.
81105
code-insiders \
82106
--extensionDevelopmentPath="$PWD" \
83107
--remote-debugging-port=9223 \
84-
--user-data-dir=~/.vscode-ext-debug
108+
--user-data-dir="$PWD/.vscode-ext-debug"
85109

86110
# Wait for VS Code to start, retry until connected
87111
for i in 1 2 3 4 5; do agent-browser connect 9223 2>/dev/null && break || sleep 3; done
112+
113+
# Verify you're connected to the right target (not about:blank)
114+
# If `tab` shows the wrong target, run `agent-browser close` and reconnect
115+
agent-browser tab
88116
agent-browser snapshot -i
89117
```
90118

91119
**Key flags:**
92120
- `--extensionDevelopmentPath=<path>` — loads your extension from source (must be compiled first). Use `$PWD` when running from the repo root.
93121
- `--remote-debugging-port=9223` — enables CDP (use 9223 to avoid conflicts with other apps on 9222)
94-
- `--user-data-dir=<path>` — uses a separate profile so it starts a new process instead of sending to an existing VS Code instance. **Always use a persistent path** (e.g., `~/.vscode-ext-debug`) rather than `/tmp/...` so authentication, settings, and extension state survive across sessions.
122+
- `--user-data-dir=<path>` — uses a separate profile so it starts a new process instead of sending to an existing VS Code instance. **Always use a persistent path** (e.g., `$PWD/.vscode-ext-debug`) rather than `/tmp/...` so authentication, settings, and extension state survive across sessions.
95123

96124
**Without `--user-data-dir`**, VS Code detects the running instance, forwards the args to it, and exits immediately — you'll see "Sent env to running instance. Terminating..." and CDP never starts.
97125

98126
> **⚠️ Authentication is required.** The Copilot Chat extension needs an authenticated GitHub session to function. Using a temp directory (e.g., `/tmp/...`) creates a fresh profile with no auth — the agent will hit a "Sign in to use Copilot" wall and model resolution will fail with "Language model unavailable."
99127
>
100-
> **Always use a persistent `--user-data-dir`** like `~/.vscode-ext-debug` (macOS/Linux) or `%APPDATA%\vscode-ext-debug` (Windows). On first use, launch once and sign in manually. Subsequent launches will reuse the auth session.
128+
> **Always use a persistent `--user-data-dir`** like `$PWD/.vscode-ext-debug`. On first use, launch once and sign in manually. Subsequent launches will reuse the auth session.
129+
130+
## Restarting After Code Changes
131+
132+
**After making changes to the extension source code, you must restart VS Code to pick up the new build.** The extension host loads the compiled bundle at startup — changes are not hot-reloaded.
133+
134+
### Restart Workflow
135+
136+
1. **Recompile** the extension
137+
2. **Kill** the running VS Code instance (the one using your debug user-data-dir)
138+
3. **Relaunch** VS Code with the same flags
139+
140+
```bash
141+
# 1. Recompile
142+
npm run compile
143+
144+
# 2. Kill the VS Code instance tied to this project's debug profile, then relaunch
145+
# macOS / Linux:
146+
kill $(ps ax -ww -o pid,command | grep "$PWD/.vscode-ext-debug" | grep -v grep | awk '{print $1}' | head -1)
147+
148+
# Windows (PowerShell):
149+
# Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like "*$PWD\.vscode-ext-debug*" } | ForEach-Object { Stop-Process -Id $_.ProcessId }
150+
151+
# 3. Relaunch
152+
code-insiders \
153+
--extensionDevelopmentPath="$PWD" \
154+
--remote-debugging-port=9223 \
155+
--user-data-dir="$PWD/.vscode-ext-debug"
156+
157+
# 4. Reconnect agent-browser
158+
for i in 1 2 3 4 5; do agent-browser connect 9223 2>/dev/null && break || sleep 3; done
159+
agent-browser snapshot -i
160+
```
161+
162+
> **Tip:** If you're iterating frequently, run `npm run watch` in a separate terminal so compilation happens automatically. You still need to kill and relaunch VS Code to load the new bundle.
101163
102164
## Interacting with Monaco Editor (Chat Input, Code Editors)
103165

@@ -131,10 +193,14 @@ agent-browser snapshot -i
131193

132194
This is the simplest and most reliable method. It works for both the main editor chat input and the sidebar chat panel.
133195

196+
> **Tip:** If `type @ref` silently drops text (the editor stays empty), the ref may be stale or the editor not yet ready. Re-snapshot to get a fresh ref and try again. You can verify text was entered using the snippet in "Verifying Text in Monaco" below.
197+
134198
#### `keyboard type` / `keyboard inserttext` — After Focus
135199

136200
If focus is already on a Monaco editor, `keyboard type` and `keyboard inserttext` both work:
137201

202+
> **⚠️ Warning:** `keyboard type` can hang indefinitely in some focus states (e.g., after JS mouse events). If it doesn't return within a few seconds, interrupt it and fall back to `press` for individual keystrokes.
203+
138204
```bash
139205
# Focus first (via type @ref, or JS mouse events, or a prior interaction)
140206
agent-browser type @e51 ""
@@ -252,13 +318,18 @@ agent-browser press Backspace
252318

253319
If `agent-browser screenshot` returns "Permission denied", your terminal needs Screen Recording permission. Grant it in **System Settings → Privacy & Security → Screen Recording**. As a fallback, use the `eval` verification snippet to confirm text was entered — this doesn't require screen permissions.
254320

255-
## Cleanup / Disconnect
321+
## Cleanup
322+
323+
**Always kill the debug VS Code instance when you're done.** Leaving it running wastes resources and holds the CDP port.
256324

257325
```bash
258-
# Disconnect agent-browser from the current session
326+
# Disconnect agent-browser
259327
agent-browser close
260328

261-
# The VS Code instance continues running
262-
```
329+
# Kill the debug VS Code instance
330+
# macOS / Linux:
331+
kill $(ps ax -ww -o pid,command | grep "$PWD/.vscode-ext-debug" | grep -v grep | awk '{print $1}' | head -1)
263332

264-
To fully stop, quit VS Code separately (e.g., `Cmd+Q` / `Alt+F4`, or kill the process).
333+
# Windows (PowerShell):
334+
# Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like "*$PWD\.vscode-ext-debug*" } | ForEach-Object { Stop-Process -Id $_.ProcessId }
335+
```

.claude/CLAUDE.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.claude/skills/launch

Lines changed: 0 additions & 1 deletion
This file was deleted.

.devcontainer/devcontainer-lock.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@
66
"integrity": "sha256:91ffef641dbe5045b9982921487d743f7a3047cc05efd9226345833f446c8bce"
77
},
88
"ghcr.io/devcontainers/features/desktop-lite:1": {
9-
"version": "1.2.6",
10-
"resolved": "ghcr.io/devcontainers/features/desktop-lite@sha256:818bb1cd8c05948e469ef2eb1b7c3f29920624c7fb805015dcc4ba6e8f5d538b",
11-
"integrity": "sha256:818bb1cd8c05948e469ef2eb1b7c3f29920624c7fb805015dcc4ba6e8f5d538b"
9+
"version": "1.2.8",
10+
"resolved": "ghcr.io/devcontainers/features/desktop-lite@sha256:14ac23fd59afab939e6562ba6a1f42a659a805e4c574a1be23b06f28eb3b0b71",
11+
"integrity": "sha256:14ac23fd59afab939e6562ba6a1f42a659a805e4c574a1be23b06f28eb3b0b71"
1212
},
13-
"ghcr.io/devcontainers/features/docker-in-docker:2": {
14-
"version": "2.12.2",
15-
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:842d2ed40827dc91b95ef727771e170b0e52272404f00dba063cee94eafac4bb",
16-
"integrity": "sha256:842d2ed40827dc91b95ef727771e170b0e52272404f00dba063cee94eafac4bb"
13+
"ghcr.io/devcontainers/features/docker-in-docker:2.16.1": {
14+
"version": "2.16.1",
15+
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:ce078b7bf7d9ef3bcb9813b32103795d8d72172446890b64772cbe1dec6baafd",
16+
"integrity": "sha256:ce078b7bf7d9ef3bcb9813b32103795d8d72172446890b64772cbe1dec6baafd"
1717
},
1818
"ghcr.io/devcontainers/features/dotnet:2": {
1919
"version": "2.2.2",
2020
"resolved": "ghcr.io/devcontainers/features/dotnet@sha256:06f4ef2c23792da4832a74da195d478d8f64316c45c7624a0367d6bd5c3fc500",
2121
"integrity": "sha256:06f4ef2c23792da4832a74da195d478d8f64316c45c7624a0367d6bd5c3fc500"
2222
},
23+
"ghcr.io/devcontainers/features/git-lfs:1": {
24+
"version": "1.2.5",
25+
"resolved": "ghcr.io/devcontainers/features/git-lfs@sha256:71c2b371cf12ab7fcec47cf17369c6f59156100dad9abf9e4c593049d789de72",
26+
"integrity": "sha256:71c2b371cf12ab7fcec47cf17369c6f59156100dad9abf9e4c593049d789de72"
27+
},
2328
"ghcr.io/devcontainers/features/python:1": {
2429
"version": "1.7.1",
2530
"resolved": "ghcr.io/devcontainers/features/python@sha256:cf9b6d879790a594b459845b207c5e1762a0c8f954bb8033ff396e497f9c301b",

.devcontainer/devcontainer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
33
{
44
"name": "Node.js & TypeScript",
5-
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22",
5+
"image": "mcr.microsoft.com/devcontainers/typescript-node:4-24",
66
"features": {
7-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
7+
"ghcr.io/devcontainers/features/docker-in-docker:2.16.1": {
8+
"moby": false
9+
},
810
"ghcr.io/devcontainers/features/azure-cli:1": {},
911
"ghcr.io/devcontainers/features/python:1": {},
1012
"ghcr.io/devcontainers/features/dotnet:2": {},

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Copilot Chat Issues
4-
url: https://github.com/microsoft/vscode/issues/new?labels=chat-oss-issue
4+
url: https://github.com/microsoft/vscode/issues/new?template=copilot_bug_report.md
55
about: Please file issues related to Copilot Chat in the VS Code repository.
66
- name: Responsible AI Service response blocking
77
url: https://github.com/microsoft/vscode/issues/253130

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: pip install setuptools
4242

4343
- name: Restore build cache
44-
uses: actions/cache/restore@v4
44+
uses: actions/cache/restore@v5
4545
id: build-cache
4646
with:
4747
key: build_cache-${{ hashFiles('build/.cachesalt', 'package-lock.json') }}

.github/workflows/ensure-node-modules-cache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
node-version-file: .nvmrc
2525

2626
- name: Restore build cache
27-
uses: actions/cache@v4
27+
uses: actions/cache@v5
2828
id: build-cache
2929
with:
3030
key: build_cache-${{ hashFiles('build/.cachesalt', 'package-lock.json') }}
@@ -64,7 +64,7 @@ jobs:
6464
architecture: 'x64'
6565

6666
- name: Restore build cache
67-
uses: actions/cache@v4
67+
uses: actions/cache@v5
6868
id: build-cache
6969
with:
7070
key: windows-build_cache-${{ hashFiles('build/.cachesalt', 'package-lock.json') }}

.github/workflows/npm-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323

2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v6
2727

2828
- name: Setup Node.js
29-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@v6
3030
with:
3131
node-version: 22.x
3232
cache: npm

0 commit comments

Comments
 (0)