Conversation
10 tasks
…rs, add type guard in matcher Co-authored-by: jaseel0 <225665919+jaseel0@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add 'run' command, injector, and matcher updates
Harden spawn, signal handling, and null-error guards across run command and runtime hooks
Mar 1, 2026
naheel0
approved these changes
Mar 1, 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.
Several robustness gaps existed in the
runcommand and the injector/auto/matcher modules: hard-coded"node"binary, missing signal-kill detection, no exit on spawn error, and unguarded property access on non-Error throws.Changes
bin/index.jsspawn("node", ...)withspawn(process.execPath, ...)so the CLI always uses the same Node binary that invoked it{ stdio: ["inherit", "pipe", "pipe"] }— stdin is inherited, stdout/stderr are pipedclosehandler now accepts(code, signal);code === nullis treated as a signal kill, logs the signal, and exits1; otherwise usesprocess.exit(code ?? 1)as a safety netchild.on("error")now callsprocess.exit(1)after logging, preventing the CLI from hanging on spawn failureslib/auto.jsErrorthrows:const msg = (err && err.message) ? err.message : String(err)passed tofindErrorinstead of bareerr.messagelib/injector.jsuncaughtExceptionandunhandledRejectionhandlers normalize the thrown value before accessing.stack/.message:null, a primitive, or a non-Error is thrown.lib/matcher.jsif (typeof input !== "string") input = String(input)beforeinput.toLowerCase()to handle non-string values passed tofindError✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.