copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Recurring Network error in Copilot CLI

Open JoergStrebel opened this issue 3 months ago • 5 comments

Describe the bug

If the prompts are longer in size, my copilot cli keeps throwing errors.

 ✗ Model call failed: "Connection error."

 ✗ Execution failed: Connection error.

I can try again after a /clear - sometimes works. But mostly fails. Models used Claude Sonnet 4.5 and 4.

Is there some sort of network timeout or limit on thinking time? If I reduce the complexity of my prompts, Copilot will usually answer them, so this is not a HTTP proxy or connectivity issue.

Affected version

0.0.341

Steps to reproduce the behavior

  1. Enter a complex prompt, usually some bigger task involving multiple files and some complex tasks.
  2. Let the LLM think for a couple of minutes
  3. Observe the error message

Expected behavior

  1. Enter a complex prompt, usually some bigger task involving multiple files and some complex tasks.
  2. Either get the desired result or get an explanation why the answer could not be generated.

Additional context

  • Shell: bash
  • Terminal: Windows Terminal (WSL)
  • CPU Architecture: x86-64
  • OS: Windows11, WSL2, Ubuntu 24
  • copilot running in WSL2, all activities happening on WSL2 , no Windows resources needed
  • Logs:
2025-10-15T07:30:20.745Z [INFO] Starting Copilot CLI: 0.0.341
Commit: 5725358
2025-10-15T07:30:20.745Z [INFO] Node.js version: v24.10.0
2025-10-15T07:30:22.240Z [LOG] Using Copilot API endpoint: https://api.business.githubcopilot.com/mcp/readonly
2025-10-15T07:30:22.241Z [LOG] Starting remote MCP client for github-mcp-server with url: https://api.business.githubcopilot.com/mcp/readonly
2025-10-15T07:30:22.241Z [LOG] Creating MCP client for github-mcp-server...
2025-10-15T07:30:22.244Z [LOG] Connecting MCP client for github-mcp-server...
2025-10-15T07:30:24.183Z [LOG] MCP client for github-mcp-server connected, took 1939ms
2025-10-15T07:30:24.183Z [LOG] Started MCP client for remote server github-mcp-server
2025-10-15T07:30:24.183Z [LOG] GitHub MCP server configured after authentication
2025-10-15T07:34:14.400Z [INFO]  
2025-10-15T07:34:21.937Z [INFO] [log_c3562d, x-request-id: "00000-5f37d1ee-fdc7-48cb-a6d8-e3b1ace560b8"] post https://api.business.githubcopilot.com/chat/completions succeeded with status 200 in 5279ms

2025-10-15T07:34:52.103Z [INFO] [log_c5e5ac] connection failed - retrying, 5 attempts remaining

2025-10-15T07:35:23.364Z [INFO] [log_96855c] connection failed - retrying, 4 attempts remaining

2025-10-15T07:35:55.345Z [INFO] [log_d3185e] connection failed - retrying, 3 attempts remaining

2025-10-15T07:36:27.947Z [INFO] [log_9f7c8a] connection failed - retrying, 2 attempts remaining

2025-10-15T07:37:02.140Z [INFO] [log_274bfe] connection failed - retrying, 1 attempts remaining

2025-10-15T07:37:39.796Z [INFO] [log_2d2e8b] connection failed - error; no more retries left

2025-10-15T07:37:39.797Z [ERROR] error (Request-ID undefined)
2025-10-15T07:37:39.798Z [ERROR] {
  "name": "CAPIError"
}
2025-10-15T07:37:39.798Z [ERROR] Retry after is not set. Giving up.
2025-10-15T07:37:39.798Z [ERROR] error
2025-10-15T07:37:39.798Z [ERROR] {
  "name": "CAPIError"
}

JoergStrebel avatar Oct 15 '25 09:10 JoergStrebel

Thank you for raising this concern and front loading it with as much information as possible, @JoergStrebel! 🦸 Let me start digging into this to understand what is going on as I agree this isn't ideal or expected.

andyfeller avatar Oct 15 '25 14:10 andyfeller

@JoergStrebel : Apologies for the delayed follow up. I'm having a bit of difficulties reproducing a sufficiently complex task to cause network connection failures.

On Monday, I'm going to wrap up changes to improve the error logging around the connection library to see if we can get more information about what is going on. When that makes it to a prerelease, I'd appreciate your help trying to reproduce this and get more information on what is happening on your end.

andyfeller avatar Oct 18 '25 14:10 andyfeller

@andyfeller Thank you for your efforts! Of course I am more than happy to help you test.

I am using Copilot CLI intensively, but I switched models some days ago. I did not observe the buggy behavior using GPT-5 during the last couple of days. It seems GPT-5 is more stable; it always delivers an answer, even in cases where Claude Sonnet would not. And it never chokes on my prompts (which include a lot of file references).

I really like Copilot CLI; it integrates nicely with my WSL2 environment (tools usage, file access etc)

JoergStrebel avatar Oct 19 '25 07:10 JoergStrebel

@JoergStrebel : There have been some improved logging changes in 0.0.351 I'm hoping will give us enough insight to understand what is going on here.

I'd appreciate if you could put them to the test so we can figure this out once and for all! 🙇

andyfeller avatar Oct 27 '25 20:10 andyfeller

I am running the version 0.0.352 of Copilot CLI and I had a pretty complex prompt which triggered the issue on Claude-Sonnet-4.5: ✗ Execution failed: terminated

The associated log contents are:

2025-10-28T13:18:44.113Z [INFO] [log_a4c997, x-request-id: "00000-b11d0139-c317-46ef-941b-d2acca4f4869"] post https://api.business.githubcopilot.com/chat/completions succeeded with status 200 in 3724ms

2025-10-28T13:18:52.704Z [INFO] [log_49086a, x-request-id: "00000-78e611ac-604d-4cbe-ab9d-bb2fc8a356fa"] post https://api.business.githubcopilot.com/chat/completions succeeded with status 200 in 4914ms

2025-10-28T13:18:59.455Z [INFO] [log_c0763a, x-request-id: "00000-75680beb-b60b-4fb1-af0d-166120536265"] post https://api.business.githubcopilot.com/chat/completions succeeded with status 200 in 4160ms

2025-10-28T13:19:05.978Z [INFO] [log_7639d9, x-request-id: "00000-ae07fb99-d91d-4ab8-9aba-ba020bcdfdaf"] post https://api.business.githubcopilot.com/chat/completions succeeded with status 200 in 4208ms

2025-10-28T13:19:12.935Z [INFO] [log_beaed8, x-request-id: "00000-10e4c05b-2264-476b-aecd-dc774a455344"] post https://api.business.githubcopilot.com/chat/completions succeeded with status 200 in 4532ms

2025-10-28T13:19:17.984Z [INFO] [log_460fb1, x-request-id: "00000-7bffd706-db5f-4a7a-a1d5-c361465b4ca9"] post https://api.business.githubcopilot.com/chat/completions succeeded with status 200 in 4092ms

2025-10-28T13:19:51.236Z [ERROR] error
2025-10-28T13:19:51.237Z [ERROR] {
  "cause": {}
}
2025-10-28T13:19:51.237Z [ERROR] Command threw error: terminated
Error: terminated
    at t.CTt (file:///home/q267028/.nvm/versions/node/v24.10.0/lib/node_modules/@github/copilot/index.js:1888:4512)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

JoergStrebel avatar Oct 28 '25 13:10 JoergStrebel