mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 13:29:44 +02:00
Bug 1: detect copilot.cmd/.bat on Windows and invoke the sibling .ps1 directly via powershell -File, bypassing cmd.exe %* re-tokenisation that mangled the multi-line -p prompt. Shared rewriteCmdToPS1() now serves cursor, pi, and copilot. Bug 2: filterCustomArgs (shared by all agent backends) strips one outer layer of shell quotes via unshellQuoteArg() before processing, so shell-style custom args like --deny-tool='write' no longer reach the CLI with literal quotes.
14 lines
508 B
Go
14 lines
508 B
Go
//go:build windows
|
|
|
|
package agent
|
|
|
|
import "log/slog"
|
|
|
|
// platformCopilotInvocation rewrites copilot.cmd → PowerShell -File
|
|
// copilot.ps1 on Windows to avoid cmd.exe %* re-tokenisation mangling
|
|
// the multi-line -p prompt built by buildCopilotArgs.
|
|
// powerShellLookup and rewriteCmdToPS1 are defined in cursor_invocation_windows.go.
|
|
func platformCopilotInvocation(lookedUp string, args []string, logger *slog.Logger) (string, []string, bool) {
|
|
return rewriteCmdToPS1("copilot", lookedUp, args, logger)
|
|
}
|