[Bug] Background bash tasks killed after ~30 minutes during active sessions with context compaction
Bug Description
Background Bash tasks (run_in_background: true) are silently killed roughly every 30 minutes in a long-running session, while persistent Monitor tasks in the same session survive for days.
Details:
- Session has been running/resumed over ~6 days with heavy activity and frequent context compaction.
- Every backgrounded shell (a supervisor script for a long-lived listener process) gets status "killed" with a "was stopped" task notification ~30-40 min after start, during active periods. During idle overnight periods the same shell survived 4+ hours, so the kills appear correlated with session activity (possibly compaction), not wall-clock time.
- No settings configured that would explain this: no BASH_DEFAULT_TIMEOUT_MS / BASH_MAX_TIMEOUT_MS / background-related keys in user or project settings.json.
- tools-reference.md and env-vars.md do not document any lifetime for background tasks, nor their interaction with context compaction, --resume, or auto-update.
- Impact: any long-lived supervisor pattern built on run_in_background requires manual re-arming dozens of times per day (38+ times in two days in our case).
Requests:
1. Document the background-task lifecycle (when/why they are terminated).
2. Provide a setting to opt long-lived tasks out of reaping, or
3. Confirm that persistent Monitor is the intended primitive for long-lived supervision, so tooling conventions can standardize on it.
Environment: macOS (Darwin 24.6), interactive session (not -p mode).
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.212
- Feedback ID: 06c0cf3f-f9bd-4550-b074-5bf2b53b6f65
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗