You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/launch/SKILL.md
+84-13Lines changed: 84 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,16 +25,39 @@ Automate VS Code Insiders with the Copilot Chat extension using agent-browser. V
25
25
5.**Interact** using element refs
26
26
6.**Re-snapshot** after navigation or state changes
27
27
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
# 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
88
116
agent-browser snapshot -i
89
117
```
90
118
91
119
**Key flags:**
92
120
-`--extensionDevelopmentPath=<path>` — loads your extension from source (must be compiled first). Use `$PWD` when running from the repo root.
93
121
-`--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.
95
123
96
124
**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.
97
125
98
126
> **⚠️ 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."
99
127
>
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
> **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.
101
163
102
164
## Interacting with Monaco Editor (Chat Input, Code Editors)
103
165
@@ -131,10 +193,14 @@ agent-browser snapshot -i
131
193
132
194
This is the simplest and most reliable method. It works for both the main editor chat input and the sidebar chat panel.
133
195
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
+
134
198
#### `keyboard type` / `keyboard inserttext` — After Focus
135
199
136
200
If focus is already on a Monaco editor, `keyboard type` and `keyboard inserttext` both work:
137
201
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
+
138
204
```bash
139
205
# Focus first (via type @ref, or JS mouse events, or a prior interaction)
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.
254
320
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.
256
324
257
325
```bash
258
-
# Disconnect agent-browser from the current session
0 commit comments