Agent mode hangs when executing commands in K8s container (echo / python / ls)
Where does the bug appear (feature/product)?
Cursor IDE (K8s plugin, Agent mode)
Describe the Bug
Hi Cursor team,
I encountered an issue when using Agent mode in Cursor with a Kubernetes container via the K8s plugin.
When executing commands in Agent mode, the terminal hangs and never returns.
This issue only occurs in the K8s container environment. In the host environment, Agent mode works normally. Plans mode also works normally in the same container environment.
Additionally, when enabling Ask Any Time in Agent mode, no popup appears and there is no response.
Issue
When executing the following commands in Agent mode:
- echo 123
- python -c “print(‘123’)”
- ls
The following happens:
- Shows “Waiting for output”
- The terminal never returns
- No output is produced
- No error message is shown
Steps to Reproduce
-
Open Cursor IDE
-
Using Remote SSH to connect (
anysphere.remote-ssh,1.0.46) -
Connect to a Kubernetes container using the K8s plugin ( anysphere.remote-containers, Version
1.0.32) dev containers: attaching to running k8s container -
Enter Agent mode
-
Let the Agent execute a command, e.g. echo 123
-
Let the Agent execute a command,
python -c “import torch, time; x=torch.zeros((8*10243)).cuda(); exec('while True: print((x2).sum(), time.sleep(0.1))')”
Expected Behavior
- Commands should execute normally
- Output should be returned
- Ask Any Time should show a popup
- GPU workload should be triggered when running CUDA code (observable via
nvidia-smi)
Actual Behavior
- Stuck at “Waiting for output”
- No output
- No error
- Ask Any Time does not appear
- watch nvidia-smi, doesn’t change
Environment
Model
I tested with composer 2, composer 2 fast, and grok 4.2 — all show the same behavior. This issue does not appear to be model-related.
Curosr About Help
Version: 2.6.20 (system setup)
VSCode Version: 1.105.1
Commit: b29eb4ee5f9f6d1cb2afbc09070198d3ea6ad760
Date: 2026-03-17T01:50:02.404Z
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200
Remote Host machine
cat /etc/os-release
PRETTY_NAME=“Ubuntu 22.04.2 LTS”
NAME=“Ubuntu”
VERSION_ID=“22.04”
VERSION=“22.04.2 LTS (Jammy Jellyfish)”
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL=“https://www.ubuntu.com/”
SUPPORT_URL=“https://help.ubuntu.com/”
BUG_REPORT_URL=“https://bugs.launchpad.net/ubuntu/”
PRIVACY_POLICY_URL=“https://www.ubuntu.com/legal/terms-and-policies/privacy-policy”
UBUNTU_CODENAME=jammy
Container
cat /etc/os-release
PRETTY_NAME=“Ubuntu 24.04.1 LTS”
NAME=“Ubuntu”
VERSION_ID=“24.04”
VERSION=“24.04.1 LTS (Noble Numbat)”
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL=“https://www.ubuntu.com/”
SUPPORT_URL=“https://help.ubuntu.com/”
BUG_REPORT_URL=“https://bugs.launchpad.net/ubuntu/”
PRIVACY_POLICY_URL=“https://www.ubuntu.com/legal/terms-and-policies/privacy-policy”
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
Container environment: Ubuntu 24.04.1 LTS
Shell: bash
System info:
cat /etc/os-release
PRETTY_NAME=“Ubuntu 24.04.1 LTS”
VERSION_ID=“24.04”
Shell info:
which sh
/usr/bin/sh
which bash
/usr/bin/bash
echo $SHELL
/bin/bash
Additional Notes
- Commands run normally when executed directly inside the container terminal
- Agent mode works normally on the host machine
- Plans mode works normally in the container
- The issue only occurs with Cursor Agent mode in the K8s container
Impact
This issue prevents Agent mode from executing any commands inside the Kubernetes container and blocks normal development workflows