fix(copilot): use --additional-mcp-config so Copilot does not exit before prompt#188
Merged
johannesjo merged 1 commit intoJun 29, 2026
Merged
Conversation
…fore prompt Copilot was launched with `--mcp-config <path>`, a flag it does not support. Copilot rejects it with "error: unknown option '--mcp-config'" and exits immediately, before Parallel Code can send the queued prompt. That surfaces in the UI as "Agent exited before prompt was sent". It happens whenever the Parallel Code MCP coordinator is wired into Copilot (running Copilot as a coordinator agent or as a coordinated sub-agent). Copilot has no `--mcp-config` flag. It accepts `--additional-mcp-config <@file|json>` (the same config shape) and also auto-discovers the workspace `.mcp.json` that Parallel Code already writes. Map Copilot to `--additional-mcp-config @<configPath>` in both the backend launch-arg builder (electron/mcp/agent-args.ts) and the renderer fallback (src/lib/agent-args.ts), mirroring the existing Codex and Antigravity special cases. Also wire Copilot session resume via `--continue` (resume the most recent session, like Claude), which previously had no resume args. Fixes johannesjo#146
Owner
|
Thank you very much! <3 |
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.
Fixes #146
Problem
Parallel Code runs agents as interactive PTY REPLs and types the queued prompt once the TUI is ready. With Copilot, the process exits on launch before the prompt is sent, surfacing as "Agent exited before prompt was sent".
Root cause: when the MCP coordinator is wired in, Copilot was grouped with the Claude-compatible agents and launched with
--mcp-config <path>. Copilot has no such flag and exits immediately:This happens whenever Copilot runs as a coordinator agent or a coordinated sub-agent (the core multi-agent workflow).
Fix
Use Copilot's real flag. Copilot reads MCP config from
--additional-mcp-config <@file|json>and auto-discovers the workspace.mcp.jsonthat Parallel Code already writes; both take the same{ "mcpServers": {...} }shape. Map Copilot to--additional-mcp-config @<configPath>in both the backend launch-arg builder (electron/mcp/agent-args.ts) and the renderer fallback (src/lib/agent-args.ts), mirroring the existing Codex and Antigravity special cases. Also wire Copilot session resume via--continue.Testing (on this machine, copilot v1.0.65, real PTY)
copilot --mcp-config @fileexits with "unknown option". After:copilot --additional-mcp-config @filelaunches and stays interactive.copilot mcp listconfirms it auto-discovers the app's.mcp.json(parallel-code (local)).copilot --continuewith no prior session starts fresh without error.npm run typecheck,npm run lint(eslint, max-warnings 0),npm run format:check,npm run lint:arch(dependency-cruiser), and the fullnpm test(vitest, 1433 tests) pass. Added unit tests for the Copilot command detection, the--additional-mcp-configmapping, and the resume arg ordering.