Skip to content

[Bug]: acp-mcp-call fallback fails in Windows PowerShell (POSIX-only snippet, exit 0 on JSON error, silent GUI-subsystem invocation) #39924

Closed

Description

@bsebb

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Run T3 Code (Beta) 0.1.11 on Windows 11 (x64) with an Antigravity ACP thread (default shell: Windows PowerShell 5.1) where delegate_task is dropped from eager MCP tools (e.g. with ~34 user skills installed, per [Bug]: Antigravity ACP drops the 8 T3 MCP tools >1,280B (incl. delegate_task & t3_thread_launch) without call_mcp_tool or T3_ACP_MCP_NODE fallback #38123).
  2. Ask the agent to spawn a T3 Code subagent, causing it to use the injected acp-mcp-call fallback (T3_ACP_MCP_NODE pointing to T3 Code (Beta).exe and T3_ACP_MCP_ENTRYPOINT pointing to ...\server.asar\apps\server\dist\bin.mjs).
  3. Run the fallback in PowerShell 5.1:
    • Passing a normal PowerShell JSON string $payload to & $env:T3_ACP_MCP_NODE $env:T3_ACP_MCP_ENTRYPOINT acp-mcp-call delegate_task $payload.
    • Escaping double quotes ($payload.Replace('"', '\"')) and running & $env:T3_ACP_MCP_NODE $env:T3_ACP_MCP_ENTRYPOINT acp-mcp-call delegate_task $escaped.

Expected behavior

  1. The injected ACP fallback instruction should work reliably on Windows PowerShell (not just POSIX shells), or acp-mcp-call should support reading JSON arguments from stdin/file/base64 to avoid shell quoting hazards.
  2. Invalid JSON input to acp-mcp-call should exit with a non-zero exit code.
  3. Invoking T3_ACP_MCP_NODE (T3 Code (Beta).exe with ELECTRON_RUN_AS_NODE=1) directly from PowerShell should wait for completion, execute the MCP call, and print the JSON result to stdout.

Actual behavior

  1. POSIX-only fallback instructions: The injected instruction uses bash syntax (ELECTRON_RUN_AS_NODE=1 "$T3_ACP_MCP_NODE" ${T3_ACP_MCP_ENTRYPOINT:+"$T3_ACP_MCP_ENTRYPOINT"} acp-mcp-call ...), which does not work in Windows PowerShell.
  2. PowerShell 5.1 quote stripping + exit code 0 on error: Passing a JSON string directly via & $env:T3_ACP_MCP_NODE ... $payload strips quotes in PowerShell 5.1 and prints:
    acp-mcp-call arguments must be valid JSON.
    with exit code 0.
  3. Silent empty output when invoked directly in PowerShell: After escaping quotes (\"), running & $env:T3_ACP_MCP_NODE $env:T3_ACP_MCP_ENTRYPOINT acp-mcp-call delegate_task $escaped exited with code 0, produced no output, and did not spawn the subagent (verified via t3_thread_list)—likely because T3 Code (Beta).exe is a Windows GUI-subsystem binary and PowerShell does not attach/redirect stdout or wait normally unless stdio is explicitly redirected.

Impact

Major degradation or frequent failure

Version or commit

0.1.11 (T3 Code Beta)

Environment

Windows 11 (NT 10.0.26200.0, x64), Windows PowerShell 5.1.26100.8875, T3 Code (Beta) 0.1.11, Antigravity ACP (gemini-4-neon)

Logs or stack traces

# Attempt 1: direct PowerShell call with JSON string
Command exited with code 0.
acp-mcp-call arguments must be valid JSON.

# Attempt 2: direct PowerShell call with \"-escaped JSON
Command exited with code 0.
(No output; t3_thread_list confirmed no child thread was created)

# Attempt 3: ProcessStartInfo with UseShellExecute = $false and RedirectStandardOutput = $true
EXIT=0
STDOUT={"content":[],"structuredContent":{"taskId":"...","childThreadId":"...","status":"starting",...},"isError":false}

Workaround

Launching T3_ACP_MCP_NODE via .NET System.Diagnostics.ProcessStartInfo with UseShellExecute = $false, RedirectStandardOutput = $true, RedirectStandardError = $true, and \"-escaped JSON succeeds and returns the full JSON response:

$env:ELECTRON_RUN_AS_NODE = "1"
$escaped = $payload.Replace('"', '\"')
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName = $env:T3_ACP_MCP_NODE
$psi.Arguments = "`"$($env:T3_ACP_MCP_ENTRYPOINT)`" acp-mcp-call delegate_task `"$escaped`""
$psi.UseShellExecute = $false
$psi.RedirectStandardOutput = $true
$psi.RedirectStandardError = $true
$p = [System.Diagnostics.Process]::Start($psi)
$out = $p.StandardOutput.ReadToEnd()
$p.WaitForExit()

Note: The reason Antigravity hit this fallback in the first place is #38123 (fix in progress in #39362), though the Windows PowerShell acp-mcp-call behavior affects any ACP provider that uses the terminal fallback on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions