Codex Desktop leaves high-CPU grep and Python child processes after an interrupted task on macOS
Summary
A Codex Desktop task that performed broad local CSV searches was interrupted, but its shell child processes were not cleaned up. Four grep processes and one Python process remained running after the task was interrupted, each consuming approximately one CPU core.
Environment
- macOS on Apple Silicon
- Codex Desktop
- Large local CSV archive
Related Codex task
- Task: Assess zinc coulombic register
- Task reference:
01a040b8-9e96-7dc3-9882-b51155163f99 - Task state: interrupted
What happened
The task launched several long-running searches and a Python CSV-analysis script. After the Codex task was interrupted, the descendant processes continued running in the background.
Observed remaining workload:
- Four recursive
grepsearches across large CSV and project directories - One Python process loading and profiling a large collection of CSV files
- Each active process used approximately 80–95% CPU
- The processes continued for several minutes until manually terminated
Expected behavior
When a Codex task is interrupted, completed, cancelled, or its parent process exits, all shell descendants started for that task should be terminated as a process group after a short graceful shutdown period.
Actual behavior
The owning Codex task ended, but its descendant grep and Python processes remained active and continued their scans.
Impact
- High sustained CPU use
- Fan activity and reduced system responsiveness
- Orphaned work can accumulate across interrupted tasks
- The user must inspect Activity Monitor and manually terminate the processes
Suggested fix
Launch each shell command in a tracked process group or job. On task completion, cancellation, interruption, crash, or app shutdown:
- Send graceful termination to the complete child process group.
- Wait briefly for cleanup.
- Force-terminate any remaining descendants.
- Surface a visible warning if cleanup fails.
Related reports
This appears related to existing reports of Codex child-process cleanup failures and high-CPU orphaned processes, especially #37770 and #21994.
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action