feat(copilot): prompt flag fix + ACP provider support#31
Open
EmmittJ wants to merge 5 commits intogastownhall:mainfrom
Open
feat(copilot): prompt flag fix + ACP provider support#31EmmittJ wants to merge 5 commits intogastownhall:mainfrom
EmmittJ wants to merge 5 commits intogastownhall:mainfrom
Conversation
c9f80ce to
f8cdc05
Compare
Copilot CLI expects prompts via `-p`/`--prompt <text>`, not as a bare positional argument. Switch the built-in copilot provider from PromptMode "arg" to "flag" with PromptFlag "--prompt". Wire PromptMode and PromptFlag through runtime.Config so the tmux adapter inserts the flag before the prompt payload in all code paths (temp-file, inline, and fallback). Guard the ResolvedProvider dereference in templateParamsToConfig with a nil check to prevent a panic when no provider is resolved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enable Copilot as a first-class ACP provider, bringing it to parity with Claude for Gas City orchestration: - SupportsACP: true — Copilot speaks ACP (JSON-RPC 2.0 over stdio) - ACPArgs: ["--acp"] — new ProviderSpec field for ACP-specific CLI flags, appended to the command when session = "acp". Unlike Claude (which auto-detects pipe mode), Copilot requires an explicit --acp flag. - ResumeFlag: "--resume" with ResumeStyle: "flag" for session resume - PermissionModes: map unrestricted → --yolo - OptionsSchema: permission_mode and model selectors for Mission Control Wire ACPArgs through the full config pipeline: ProviderSpec → compose (deepMergeProvider) → resolve (specToResolved) → ResolvedProvider → template_resolve (command construction) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
copilot --acp starts a TCP server waiting for connections, not a stdio-based JSON-RPC process. The --stdio flag switches it to use stdin/stdout for ACP communication, which is what Gas City's ACP adapter expects when piping JSON-RPC messages. Without --stdio, Gas City's ACP handshake hangs indefinitely until the handshake_timeout fires, causing sessions to appear stuck in 'creating' state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…quest Copilot's ACP implementation requires protocolVersion (integer) in the initialize params — omitting it returns a -32603 Internal error: 'expected number, received undefined'. This caused every ACP handshake to silently fail and sessions to hit the 30s handshake timeout. Also add clientCapabilities (terminal + fs) to match what the go-acp library and Legion's vessel-driver send. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…notification Copilot requires both 'cwd' and 'mcpServers' fields in session/new params (null or empty object returns -32603). Add SessionNewParams struct with required fields; mcpServers sent as empty array when none configured. Remove the 'initialized' notification between initialize and session/new — ACP does not define this step (it's an MCP concept) and Copilot ignores it. Bump default handshake_timeout from 30s to 60s since session/new triggers a model list fetch from GitHub API (~5s on good networks). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d69a6db to
4a7b1ae
Compare
Author
|
@julianknutsen this should be good for review. If you would like me to split anything out, let me know. |
EmmittJ
added a commit
to EmmittJ/gascity
that referenced
this pull request
Mar 20, 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.
Summary
Brings the built-in Copilot provider to parity with Claude as a first-class ACP provider in Gas City.
Changes
Fix:
--promptflag deliveryThe Copilot provider was configured with
prompt_mode = "arg", passing prompts as bare positional arguments. Copilot CLI expects--prompt <text>instead.PromptMode: "arg"→PromptMode: "flag",PromptFlag: "--prompt"PromptMode/PromptFlagfields toruntime.ConfigPromptMode/PromptFlagfromResolvedProviderintoruntime.Config(nil-guarded)Feat: ACP support for Copilot
SupportsACP: true,ACPArgs: ["--acp", "--stdio"],ResumeFlag,ResumeStyle,PermissionModes,OptionsSchemato copilot builtin; addACPArgs []stringfield toProviderSpecandResolvedProvideracp_argsslice merging indeepMergeProviderACPArgsinspecToResolvedACPArgsto command whensession = "acp"Fix: ACP protocol correctness for Copilot
Copilot's ACP server uses strict schema validation. Several protocol issues required fixing:
--stdioflag:copilot --acpalone starts a TCP server;--stdioswitches it to JSON-RPC over stdin/stdout (required for Gas City's pipe-based adapter). This flag is not shown incopilot --helpbut is accepted.protocolVersion: Added integer field (1) toInitializeParams— omitting it causes-32603 Internal error: expected number, received undefinedsession/newparams: Copilot requires bothcwd(string) andmcpServers(array) — sendingnullor{}returns a validation error; addedSessionNewParams+MCPServerstructs and wiredworkDirthrough to the handshakeinitializednotification: Gas City was sending an MCP lifecycle notification betweeninitializeandsession/new; this is not part of the ACP spec and Copilot hangs on itsession/newwhich takes ~5sTesting
Verified end-to-end:
gc session new mayorwithsession = "acp"successfully starts a Copilot ACP process (copilot --yolo --acp --stdio --prompt ...) and transitions the session toawake.