fix(tmux-subagent): cap stale close retries
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -196,25 +196,30 @@ export class TmuxSessionManager {
|
||||
continue
|
||||
}
|
||||
|
||||
const nextRetryCount = tracked.closeRetryCount + 1
|
||||
if (nextRetryCount >= MAX_CLOSE_RETRY_COUNT) {
|
||||
log("[tmux-session-manager] force removing close-pending session after failed retry", {
|
||||
sessionId: tracked.sessionId,
|
||||
paneId: tracked.paneId,
|
||||
closeRetryCount: nextRetryCount,
|
||||
})
|
||||
this.removeTrackedSession(tracked.sessionId)
|
||||
const currentTracked = this.sessions.get(tracked.sessionId)
|
||||
if (!currentTracked || !currentTracked.closePending) {
|
||||
continue
|
||||
}
|
||||
|
||||
this.sessions.set(tracked.sessionId, {
|
||||
...tracked,
|
||||
const nextRetryCount = currentTracked.closeRetryCount + 1
|
||||
if (nextRetryCount >= MAX_CLOSE_RETRY_COUNT) {
|
||||
log("[tmux-session-manager] force removing close-pending session after failed retry", {
|
||||
sessionId: currentTracked.sessionId,
|
||||
paneId: currentTracked.paneId,
|
||||
closeRetryCount: nextRetryCount,
|
||||
})
|
||||
this.removeTrackedSession(currentTracked.sessionId)
|
||||
continue
|
||||
}
|
||||
|
||||
this.sessions.set(currentTracked.sessionId, {
|
||||
...currentTracked,
|
||||
closePending: true,
|
||||
closeRetryCount: nextRetryCount,
|
||||
})
|
||||
log("[tmux-session-manager] retried close failed", {
|
||||
sessionId: tracked.sessionId,
|
||||
paneId: tracked.paneId,
|
||||
sessionId: currentTracked.sessionId,
|
||||
paneId: currentTracked.paneId,
|
||||
closeRetryCount: nextRetryCount,
|
||||
})
|
||||
}
|
||||
@@ -642,6 +647,16 @@ export class TmuxSessionManager {
|
||||
const tracked = this.sessions.get(sessionId)
|
||||
if (!tracked) return
|
||||
|
||||
if (tracked.closePending && tracked.closeRetryCount >= MAX_CLOSE_RETRY_COUNT) {
|
||||
log("[tmux-session-manager] force removing close-pending session after max retries", {
|
||||
sessionId,
|
||||
paneId: tracked.paneId,
|
||||
closeRetryCount: tracked.closeRetryCount,
|
||||
})
|
||||
this.removeTrackedSession(sessionId)
|
||||
return
|
||||
}
|
||||
|
||||
log("[tmux-session-manager] closing session pane", {
|
||||
sessionId,
|
||||
paneId: tracked.paneId,
|
||||
|
||||
Reference in New Issue
Block a user