singularity-forge/src/resources/extensions/bg-shell
deseltrus 886c5837ff fix(bg-shell): prevent signal handler accumulation + cap alert queue
Signal handlers (SIGTERM, SIGINT, beforeExit) were registered on every
session_start but never removed. Over multiple sessions within the same
process, handlers accumulated — each adding another cleanupAll() call
and descendant kill sweep on exit.

Fix: session_shutdown now calls process.off() for each handler before
cleanupAll(), preventing accumulation.

Also: signalCleanup now kills ALL descendant processes (not just those
tracked by bg-shell) to catch bash-tool spawned children.

Alert queue: pendingAlerts is capped at 50 entries to prevent unbounded
growth when background processes generate rapid alerts faster than the
agent consumes them.

pushAlert signature updated to accept null bg parameter for system-level
alerts that don't originate from a tracked process.
2026-04-06 09:52:36 +02:00
..
bg-shell-command.ts refactor(bg-shell): split 1604-line god file into tool, command, and lifecycle modules (#1049) 2026-03-17 18:36:24 -06:00
bg-shell-lifecycle.ts fix(bg-shell): prevent signal handler accumulation + cap alert queue 2026-04-06 09:52:36 +02:00
bg-shell-tool.ts refactor(bg-shell): split 1604-line god file into tool, command, and lifecycle modules (#1049) 2026-03-17 18:36:24 -06:00
extension-manifest.json fix(extensions): update provides.hooks in 7 extension manifests to match actual registrations (#3157) 2026-03-31 11:54:41 -06:00
index.ts Improve startup performance with lazy extension loading (#1336) 2026-03-19 07:38:50 -06:00
interaction.ts feat: managed RTK integration with opt-in preference and web UI toggle (#2620) 2026-03-26 09:33:07 -06:00
output-formatter.ts refine: extensions elegance improvements (#1503) 2026-03-19 16:59:52 -06:00
overlay.ts fix(memory): fix memory and resource leaks across TUI, LSP, DB, and automation (#2314) 2026-03-24 07:23:36 -06:00
process-manager.ts fix(bg-shell): prevent signal handler accumulation + cap alert queue 2026-04-06 09:52:36 +02:00
readiness-detector.ts refactor: decompose bg-shell/index.ts into focused modules 2026-03-15 17:27:56 -06:00
types.ts refine: extensions elegance improvements (#1503) 2026-03-19 16:59:52 -06:00
utilities.ts fix(bg-shell): recover from deleted cwd in timers (#2850) 2026-03-27 09:54:31 -06:00