fix: auto-close zombie sessions on queue owner shutdown (#47)#66
Closed
manthan787 wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix: auto-close zombie sessions on queue owner shutdown (#47)#66manthan787 wants to merge 1 commit intoopenclaw:mainfrom
manthan787 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…penclaw#47) When the queue owner shuts down (TTL expired, no more tasks), mark the session as closed if the agent process has already exited. This prevents zombie session records from accumulating in ~/.acpx/sessions/ with closed=false despite the agent being dead.
Member
|
Superseded by #70, which merged the queue-owner shutdown auto-close fix into main on 2026-03-09. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.acpx/sessions/withclosed=falsedespite the agent being deadFixes #47
Details
The fix is in
runSessionQueueOwner'sfinallyblock insrc/session-runtime.ts. After releasing the queue owner lease, it reads the session record and marks itclosed: trueiflastAgentExitAtis set (indicating the agent has exited). This is best-effort — if the record is already cleaned up, the error is silently ignored.The condition
!record.closed && record.lastAgentExitAtensures:sessions closeare not double-writtenTest plan
session auto-closes when queue owner exits and agent has exited (#47)— creates a session, sends a prompt with--ttl 1, waits for queue owner exit, verifiesclosed: trueandclosed_atare set on the session recordprompt reuses warm queue owner pid across turnswhich verifies the fix doesn't break warm queue owner behavior)