Copilot agent terminal commands falsely time out while command has already completed
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
# Bug report draft: Copilot agent terminal commands falsely time out while command has already completed
## Summary
Copilot agent terminal executions intermittently report a timeout/wait state even though the command has already finished and the shell prompt has returned. Pressing Enter in the terminal can clear the wait state. This reproduces with trivial commands.
## Environment
- OS: Linux (NixOS)
- VS Code: 1.129.1
- Workspace: /home/rconway/nixos
- Shell context observed:
- Interactive terminal is zsh
- Agent command shell was switched to bash via automation profile
## Problem statement
When the Copilot agent runs a command and waits for stdout/command completion, the request can remain in a false waiting state. The command is already done and prompt is visible, but the tool reports timeout or appears stuck.
## Reproduction
1. Open Copilot agent in VS Code.
2. Run a silent command such as:
- true
- printf ''
3. Observe that command output shows completion and shell prompt returns.
4. Agent/tool still sometimes reports timeout/waiting.
5. In some sessions, pressing Enter in the terminal unblocks the wait state.
## Expected behavior
- When the command exits and prompt returns, Copilot marks command complete immediately.
## Actual behavior
- Copilot intermittently reports timeout/waiting despite command having already completed.
## Diagnostics performed
- Sandbox disabled and re-tested: issue still reproduces.
- Switched automation shell to bash: issue still reproduces.
- Used clean bash args (--noprofile, --norc): issue still reproduces.
- Added workaround to force a completion marker on shell EXIT: improved but did not fully resolve.
## Quantified reliability test
20 sequential runs after workaround:
- Immediate completion responses: 11
- False-timeout responses: 9
- False-timeout rate: 45%
By command type:
- Silent success (true): 7 runs, 3 false timeouts
- Silent zero-output (printf ''): 2 runs, 2 false timeouts
- Silent non-zero (exit 7): 2 runs, 1 false timeout, 1 immediate non-zero completion
- Stdout commands: 5 runs, 1 false timeout
- Stderr commands: 4 runs, 2 false timeouts
## Workaround attempted
Workspace-only workaround added:
- Agent automation shell configured to bash with clean args
- Non-interactive bash EXIT trap emits completion marker to stderr
Files used for workaround in this workspace:
- .vscode/settings.json
- .vscode/copilot-bash-env.sh
This reduced but did not eliminate false timeouts.
## Impact
- Agent appears hung for common command flows.
- Requires manual intervention (press Enter / poll terminal output), reducing trust and automation reliability.
## Suspected area
Terminal completion/idle detection race or prompt-return detection in Copilot terminal bridge, especially for low-output or no-output command exits.
## Requested fix
- Treat process exit as authoritative completion even with no stdout.
- Improve idle/prompt detection for silent exits.
- Avoid requiring additional terminal input after completed commands.
## Optional additional details to include before submitting
- Copilot extension version
- Copilot Chat extension version
- Any exported logs from the failing session
VS Code version: Code 1.129.1 (8a7abeba6e03ea3af87bfbce9a1b7e48fed567b8, 2026-07-17T15:35:09Z)
OS version: Linux x64 7.1.4
Modes:
System Info
|Item|Value|
|---|---|
|CPUs|11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz (8 x 3400)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x0000 [Google Inc. (Intel)], DEVICE=0x0000 [ANGLE (Intel, Mesa Intel(R) Iris(R) Xe Graphics (TGL GT2), OpenGL ES 3.2 Mesa 26.1.5)], DRIVER_VENDOR=Mesa, DRIVER_VERSION=26.1.5 *ACTIVE*
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgpu: enabled
webgpu_on_vk_via_gl_interop: disabled_off
webnn: disabled_off|
|Load (avg)|0, 1, 1|
|Memory (System)|46.76GB (42.28GB free)|
|Process Argv|nixos --crash-reporter-id 66a6e5fc-04d7-4bb6-b3d5-7a82582806c8|
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|gnome|
|XDG_CURRENT_DESKTOP|GNOME|
|XDG_SESSION_DESKTOP|gnome|
|XDG_SESSION_TYPE|wayland|
Extensions (40)
Name|Identifier|Author|Version
---|---|---|---
Astro|astro-build.astro-vscode|astro-build|2.16.17
Nix|bbenoist.nix|bbenoist|1.0.1
Ruff|charliermarsh.ruff|charliermarsh|2026.66.0
Docker DX|docker.docker|docker|0.18.0
XML Tools|dotjoshjohnson.xml|DotJoshJohnson|2.5.1
GitLens — Git supercharged|eamodio.gitlens|eamodio|18.3.0
Prettier - Code formatter|esbenp.prettier-vscode|esbenp|12.4.0
shell-format|foxundermoon.shell-format|foxundermoon|7.2.8
GitHub Codespaces|github.codespaces|GitHub|1.18.15
GitHub Actions|github.vscode-github-actions|github|0.32.3
GitHub Pull Requests|github.vscode-pull-request-github|GitHub|0.158.0
Go|golang.go|golang|0.56.0
HashiCorp Terraform|hashicorp.terraform|hashicorp|2.40.0
REST Client|humao.rest-client|humao|0.25.1
PlantUML|jebbs.plantuml|jebbs|2.18.1
Git Graph|mhutchie.git-graph|mhutchie|1.30.0
Container Tools|ms-azuretools.vscode-containers|ms-azuretools|2.4.5
Docker|ms-azuretools.vscode-docker|ms-azuretools|2.0.0
Kubernetes|ms-kubernetes-tools.vscode-kubernetes-tools|ms-kubernetes-tools|1.4.1
Python Debugger|ms-python.debugpy|ms-python|2026.6.0
Python|ms-python.python|ms-python|2026.4.0
Pylance|ms-python.vscode-pylance|ms-python|2026.3.1
Python Environments|ms-python.vscode-python-envs|ms-python|1.36.0
Jupyter|ms-toolsai.jupyter|ms-toolsai|2025.9.1
Jupyter Keymap|ms-toolsai.jupyter-keymap|ms-toolsai|1.1.2
Jupyter Notebook Renderers|ms-toolsai.jupyter-renderers|ms-toolsai|1.3.0
Jupyter Cell Tags|ms-toolsai.vscode-jupyter-cell-tags|ms-toolsai|0.1.9
Jupyter Slide Show|ms-toolsai.vscode-jupyter-slideshow|ms-toolsai|0.1.6
Dev Containers|ms-vscode-remote.remote-containers|ms-vscode-remote|0.466.0
Remote - SSH|ms-vscode-remote.remote-ssh|ms-vscode-remote|0.124.0
Remote - SSH: Editing Configuration Files|ms-vscode-remote.remote-ssh-edit|ms-vscode-remote|0.87.0
WSL|ms-vscode-remote.remote-wsl|ms-vscode-remote|0.104.3
Hex Editor|ms-vscode.hexeditor|ms-vscode|1.11.1
Remote Explorer|ms-vscode.remote-explorer|ms-vscode|0.5.0
YAML|redhat.vscode-yaml|redhat|1.24.0
rust-analyzer|rust-lang.rust-analyzer|rust-lang|0.3.2981
opencode|sst-dev.opencode|sst-dev|0.0.13
Tailscale|tailscale.vscode-tailscale|Tailscale|1.1.0
vscode-pdf|tomoki1207.pdf|tomoki1207|1.2.2
Markdown All in One|yzhang.markdown-all-in-one|yzhang|3.6.3
A/B Experiments
```
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
4f60g487:31327383
envsactivate1:31551504
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
c3h7c220:31478652
ge8j1254_inline_auto_hint_haiku:31490510
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
test_treatment2:31471001
46204921:31447328
control_6dc23131:31555649
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
nes-extended-on:31455476
chat:31457767
8hig5102:31480529
89g7j272:31518289
7e187181:31503455
i2gc6536:31499202
52612955:31516516
ghj88844:31499326
ddid_c:31478207
hmra_i5g22:31518061
g35_d1382936:31554123
bjc72774_agent_sandbox:31554070
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
cdk-lw-on:31524445
f9bf7985:31543584
a1ije391_t:31540920
hgf2d445:31529595
8hfba999:31537718
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
gf14b233:31526830
nes-curr-leftover-1500:31538366
8hjh2968:31555644
h561g132:31533256
session_8:31532895
chatquotatrajectorynudge-control:31548766
hjji5903:31534458
f412h606:31551416
7g2b5551:31542111
sandbox-ui-on-2:31543161
enable_editor_pane_layout:31554332
allow-none:31555437
6i51c363:31551401
nes-gb3-nf-5k:31554345
1532g621_copy:31554320
d4c76da2:31554780
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
```
Contributor guide
Assessment
This issue has not been assessed yet.