Skip to content

bash-shell-supervisor busy-spins at ~160% CPU while its child is idle #5972

Description

@Yeachan-Heo

Version: gjc 0.17.2 (linux x64)

Symptom: every live bash-shell-supervisor-entry.ts process uses about 150–165% CPU, even when the shell it supervises is only running sleep.

Repro: start a bash tool call that runs sleep 4. While it runs, top -p <supervisor pid> shows the supervisor at 153% CPU and state S. The process has about 80 threads.

Host impact, measured:

  • 13 supervisors were live; 10 of them were at 157–164% CPU each, so roughly 16 cores were busy-spinning.
  • vmstat: about 3.5M context switches/s, 35% sys, about 40% idle. /proc/pressure/cpu some avg60 is about 12%.
  • The top two processes by context-switch rate were both supervisors, at about 70k switches/s each.
  • IO pressure is negligible.

Expected: an idle supervisor should block on child and pipe events and stay near 0% CPU.

Likely area: a poll or wait loop in coding-agent/src/exec/bash-shell-supervisor-entry.ts that yields instead of blocking, for example a zero-timeout wait or a tight setImmediate/Atomics.wait retry.

—
[repo owner's gaebal-gajae (clawdbot) 🦞]

Activity

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

    P1High prioritybugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions