- BackgroundManager.shutdown() now aborts all running child sessions via client.session.abort() before clearing state, preventing orphaned opencode processes when parent exits - Add onShutdown callback to BackgroundManager constructor, used to trigger TmuxSessionManager.cleanup() on process exit signals - Interactive bash session hook now aborts tracked subagent opencode sessions when killing tmux sessions (defense-in-depth) - Add 4 tests verifying shutdown abort behavior and callback invocation Closes #1240
This commit is contained in:
@@ -264,6 +264,11 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
});
|
||||
log("[index] onSubagentSessionCreated callback completed");
|
||||
},
|
||||
onShutdown: () => {
|
||||
tmuxSessionManager.cleanup().catch((error) => {
|
||||
log("[index] tmux cleanup error during shutdown:", error)
|
||||
})
|
||||
},
|
||||
});
|
||||
|
||||
const atlasHook = isHookEnabled("atlas")
|
||||
|
||||
Reference in New Issue
Block a user