launch: build copilot in compile; wait for CDP in launch.sh#318272
Merged
Conversation
Two related improvements to the agent dev-loop workflow: - npm run compile now builds the Copilot extension in parallel with the rest of the client, mirroring the structure of npm run watch. Previously only the watch path included extensions/copilot, so a one-shot build left the Copilot extension stale. - .agents/skills/launch/scripts/launch.sh now runs preLaunch.ts in the foreground (surfacing any failure synchronously with a log tail), then launches Code OSS with VSCODE_SKIP_PRELAUNCH=1 and blocks until the renderer's CDP endpoint responds (90s timeout) before printing the JSON. Previously the script returned in ~1s while Electron was still mid- bootstrap, which made it racy for agents driving the workbench via @playwright/cli and could let an early-dying child go unnoticed. SKILL.md updated to drop the now-unnecessary attach retry loop and to document the new error-surfacing behavior. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the agent dev-loop workflow by ensuring a one-shot npm run compile also builds the Copilot extension, and by making the launch.sh skill wait until Code OSS is actually ready for CDP-based automation before returning.
Changes:
- Update root
compileto run client compilation and Copilot extension compilation in parallel. - Run
preLaunch.tsin the foreground inlaunch.sh, then startcode.shdetached and poll the CDP endpoint before printing launch JSON. - Update the launch skill documentation to reflect the new compile behavior and remove the Playwright retry-attach loop.
Show a summary per file
| File | Description |
|---|---|
| package.json | Makes npm run compile also build extensions/copilot via a new parallel script setup. |
| .agents/skills/launch/SKILL.md | Documents the new one-shot compile behavior and the “CDP-ready” launch semantics (no retry loop). |
| .agents/skills/launch/scripts/launch.sh | Runs prelaunch synchronously, launches Code OSS detached, and blocks until the CDP endpoint responds (or fails with log tail). |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 1
Per code review, `launch.sh` does not invoke `lsof` or `jq` itself those are used only by the example caller snippets. Reword the prerequisites bullet so it reflects what the script actually requires (`rsync`, `curl`, `nohup`, Node) and notes `jq` / `lsof` as optional for the caller-side examples. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
justschen
approved these changes
May 26, 2026
anthonykim1
added a commit
that referenced
this pull request
May 26, 2026
Squashed cherry-pick of 10 commits from main that are included in the Insiders build (183159e) people are verifying: - agentHost: show fetched URL for web_fetch (#318240) - Fix SSH remote agent host passphrase auth (#318244) - agentHost: add setting to disable worktreeCreated task auto-dispatch (#318243) - Agent host: clearer worktree git timeout errors and 60s budget (#318242) - Normalize LF to CRLF in agent host terminal tool output (#318257) - sessions: restore X-button removal of SSH remote agent host entries (#318262) - chat: fix duplicate command registration for agent-host-copilotcli (#318273) - launch: build copilot in compile; wait for CDP in launch.sh (#318272) - Preserve unread state across remote host disconnect (#318267) - Add more codenotify for terminal (#318285)
dileepyavan
pushed a commit
that referenced
this pull request
May 27, 2026
Squashed cherry-pick of 10 commits from main that are included in the Insiders build (183159e) people are verifying: - agentHost: show fetched URL for web_fetch (#318240) - Fix SSH remote agent host passphrase auth (#318244) - agentHost: add setting to disable worktreeCreated task auto-dispatch (#318243) - Agent host: clearer worktree git timeout errors and 60s budget (#318242) - Normalize LF to CRLF in agent host terminal tool output (#318257) - sessions: restore X-button removal of SSH remote agent host entries (#318262) - chat: fix duplicate command registration for agent-host-copilotcli (#318273) - launch: build copilot in compile; wait for CDP in launch.sh (#318272) - Preserve unread state across remote host disconnect (#318267) - Add more codenotify for terminal (#318285)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related improvements to the agent dev-loop workflow (the launch skill used by Copilot CLI / agent host to drive a Code OSS dev build).
npm run compilenow also builds the Copilot extensionThe
compilescript used to run onlygulp compile, which builds the client, built-in extensions, and extension but not the Copilot extension inextensions/copilot/. That extension has its own esbuild script and was only included innpm run watch. Result: a one-shotnpm run compileleft the Copilot extension stale, and there was no documented one-line equivalent ofnpm run watch.mediaNow
compilerunscompile-client(the previouscompile) and a newcompile-copilotin parallel vianpm-run-all2 -lp, mirroring the structure ofwatch.launch.shblocks until Code OSS is actually readyThe launcher used to
&code.shand return within ~1s. Butcode.shfirst runspreLaunch.ts(electron download, compile-if-missing, built-in extensions), and Electron itself takes several more seconds to bootstrap and open the CDP port. That meant:nohup@playwright/clihad to implement a retry-attach loop.code.shdied early (bad flag, broken build, etc.), the failure was the launcher returned a JSON blob with PID/ports that referred to a dead process.silentThe new flow:
preLaunch.tsin the foreground so any error surfaces synchronously with a log tail and a non-zero exit code.code.shwithVSCODE_SKIP_PRELAUNCH=1(skipping the duplicate work) and detaches with& disown.nohuphttp://127.0.0.1:$CDP/json/versionfor up to 90s before printing the JSON. Ifcode.shexits or CDP never opens, prints the log tail and exits non-zero.End-to-end timing: launch.sh now returns in ~10s with CDP already open, so
npx @playwright/cli attachworks immediately with no retry loop.SKILL.mdupdated to drop the retry loop and document the new error-surfacing behavior.Notes for reviewers
.agents/skills/launch/andpackage.json. No production source changes.compile-client/compile-copilotare new internal npm script names; nothing in CI/build calls these by those names today, but if any other process invokesnpm run compileit will pick up the parallel build automatically.(Written by Copilot)