Description
Bug Description
There appears to be a bug in the ShellTracker where short-lived shell commands that complete in sync mode are still being reported as running in the status updates.
Observed Behavior
The periodic status messages report a large number of shells in the "running" status, even though these were short-lived commands that have already completed.
Expected Behavior
Once a shell command completes, regardless of whether it runs in sync or async mode, it should be properly marked as completed in the ShellTracker.
Potential Root Cause
The issue may be related to how process completion is handled for commands that don't enter async mode. It appears that the shell status isn't being properly updated for commands that complete within the timeout period.
Steps to Reproduce
- Run multiple short-lived shell commands
- Observe status updates showing these commands as still running
Impact
This causes confusion as the status updates show many "running" shell processes that are actually completed, making it difficult to track which processes are genuinely still running.
Proposed Investigation
- Add tests that specifically verify shell status tracking for sync-mode commands
- Examine the shellStart implementation to ensure status is properly updated for both sync and async execution paths