Make normalizeSpawn truly async to prevent event loop blocking#55
Draft
Copilot wants to merge 4 commits intobranch-4-devtestfrom
Draft
Make normalizeSpawn truly async to prevent event loop blocking#55Copilot wants to merge 4 commits intobranch-4-devtestfrom
Copilot wants to merge 4 commits intobranch-4-devtestfrom
Conversation
- Update DoctorDependencies.spawnCommand to return Promise - Update LaunchDependencies (extends DoctorDependencies) - Modify normalizeSpawn to return async wrapper function - Await all spawnCommand calls in launch.ts (preflight, auth, mcp registration) - Await all spawnCommand calls in doctor.ts (cli help, login status, mcp list) - Update launch.test.ts with async spawnCommand mocks - Update doctor.test.ts with async spawnCommand mocks - All tests pass (9/9) Co-authored-by: clduab11 <185000089+clduab11@users.noreply.github.com>
Replace wrapped spawnSync with proper async spawn implementation: - Add spawnAsync helper using child_process.spawn with Promise - Update doctor.ts to use spawnAsync by default - Update launch.ts to use spawnAsync by default - Prevents actual event loop blocking (not just wrapping sync in async) - All tests still pass (9/9) Co-authored-by: clduab11 <185000089+clduab11@users.noreply.github.com>
Document that spawnAsync always resolves (never rejects) to match spawnSync API: - Errors communicated via status code and stderr - Matches expected behavior of calling code - Prevents unnecessary try/catch blocks in callers - All tests still pass (9/9) Co-authored-by: clduab11 <185000089+clduab11@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add launch orchestrator and docker auth support
Make normalizeSpawn truly async to prevent event loop blocking
Feb 14, 2026
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.
The
normalizeSpawnfunction inlaunch.tsreturned a synchronous wrapper that calledspawnSync, blocking the event loop during asyncrunLaunchpreflight checks.Changes
spawnSyncwith asyncspawn— AddedspawnAsynchelper that wrapschild_process.spawnin a Promise, collecting stdout/stderr via streams without blockingDoctorDependencies.spawnCommandto returnPromise<...>awaitto preflight check, codex auth, and MCP registration flows in bothlaunch.tsanddoctor.tsspawnCommandtest doubles asyncImplementation
The
spawnAsyncwrapper always resolves (never rejects) to matchspawnSyncAPI contract, communicating errors via status code and stderr:This preserves existing error handling patterns while eliminating event loop blocking.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.