Skip to content

v0.10.0-insider.1: Tool execution hangs after preToolUse hook completes (no tool.execution_complete) in multi-MCP setup #1353

Closed

Description

@tamirdresher

Summary

In a fresh squad init'd folder running Squad CLI v0.10.0-insider.1 on GitHub Copilot CLI v1.0.63 (Windows), the first tool the assistant tries to invoke (powershell reading .squad/team.md) hangs indefinitely after the preToolUse hook completes successfully. The actual tool process is never spawned, and no tool.execution_complete event is ever emitted.

Reproduced twice in the same session (after Ctrl+C abort, retry hit the identical hang on the very next tool call).

Environment

Copilot CLI 1.0.63
Squad CLI 0.10.0-insider.1 (via npx -y @bradygaster/squad-cli@0.10.0-insider.1 state-mcp)
OS Windows 11
Folder C:\temp\perception-squad — fresh scaffold, vanilla layout, no custom plugins
Model claude-opus-4.7, effort max, context long_context
MCP servers loaded 8 total: azure-devops, playwright, aspire, enghub, teams (agency), mail (agency), nano-banana, squad_state

Reproduction

  1. cd C:\temp\perception-squad
  2. copilot to start a fresh session
  3. Wait through MCP startup (all 6 user-level MCPs + squad_state emit "taking longer than expected to connect" warnings — squad_state starts last, ~45s after session start)
  4. Prompt the assistant with anything that should trigger a tool call. In our case: "hi" → assistant ran if (Test-Path .squad/team.md) { Write-Host "===TEAM_EXISTS==="; Get-Content .squad/team.md }

Observed behavior

From events.jsonl:

12:31:27  assistant.turn_start
12:31:27  assistant.message    (Squad banner)
12:31:27  tool.execution_start (toolName="powershell", reading team.md)
12:31:27  hook.start  (preToolUse)
12:31:32  hook.end    (preToolUse, success=true)
... silence for ~10 minutes ...
12:41:10  abort       (reason="user_initiated"  ← Ctrl+C)

No tool.execution_complete event ever fired. The session was retried after abort and hit the identical hang on the very next tool call (same pattern: tool.execution_start → hook.end → silence).

Event tally over 28 minutes of session lifetime:

Event type Count
tool.execution_start 2
tool.execution_complete 0 ⚠️
session.warning (MCP slow-to-connect) 6
Errors 0

Process-level diagnostic

The hung copilot.exe (PID 63572) was alive (1465s CPU, 188 MB RSS) but no powershell.exe / pwsh.exe child process was ever spawned. All 8 MCP server child processes were alive and idle. The hang is in the CLI's tool dispatch path between hook.end and child_process.spawn(powershell).

Hypothesis

Race condition between Squad CLI's state-mcp initialization (which connects ~45s into the session) and Copilot CLI's tool dispatcher. When many MCPs are still settling, the CLI's post-hook dispatch path may be blocked on an unfulfilled IPC promise.

Possibly a Copilot CLI bug, but the Squad state-mcp is the late-connecting MCP that pushes the session over the edge.

Workaround tested

Reducing the global mcp-config.json from 7 MCPs to 3 (kept: enghub, teams, mail; dropped: aspire, azure-devops, playwright, nano-banana) — pending verification by user.

Asks

  1. Could state-mcp startup be made non-blocking / lazy, only initializing on first tool call?
  2. Is there a known interaction between preToolUse hooks and parallel MCP initialization in 0.10.0-insider.1?
  3. Worth a --no-state-mcp flag for repro / debugging?

Happy to attach the full events.jsonl (~285 KB) if useful — it's redacted-safe (just protocol events, no message content). Just say the word.

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

    triagedIssue has been triagedwave:1-nextWave 1 — immediate next sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions