fix(tmux): reassign anchor pane on first subagent deletion

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-03 18:12:33 +09:00
parent e4846fba6b
commit 6cb7028ef7
2 changed files with 116 additions and 0 deletions
+18
View File
@@ -172,6 +172,20 @@ export class TmuxSessionManager {
}
}
private reassignIsolatedContainerAnchor(): boolean {
const nextAnchor = this.sessions.values().next().value
if (!nextAnchor) {
return false
}
this.isolatedWindowPaneId = nextAnchor.paneId
log("[tmux-session-manager] reassigned isolated container anchor pane", {
sessionId: nextAnchor.sessionId,
paneId: nextAnchor.paneId,
})
return true
}
private async cleanupIsolatedContainerAfterSessionDeletion(
tracked: TrackedSession,
isolatedPaneAlreadyClosed: boolean,
@@ -182,6 +196,10 @@ export class TmuxSessionManager {
}
if (this.sessions.size > 0) {
if (this.reassignIsolatedContainerAnchor()) {
return
}
return
}