Skip to content

fix: preserve workspace when session kill teardown fails - #444

Open
baladithyab wants to merge 1 commit into
aoagents:mainfrom
baladithyab:ao/agent-orchestrator-8/root
Open

baladithyab wants to merge 1 commit into
aoagents:mainfrom
baladithyab:ao/agent-orchestrator-8/root

Conversation

@baladithyab

@baladithyab baladithyab commented Aug 31, 2026 •

Copy link
Copy Markdown

Fixes #440.

When workspace removal fails, session kill has already recorded terminal intent and torn down the runtime. Treat the remaining worktree as preserved instead of returning an opaque 500 that can strand the session as exited but non-terminated. Unexpected teardown failures remain observable through the daemon warning log.

Regression coverage asserts that an arbitrary workspace teardown failure returns freed=false, preserves the worktree, destroys the runtime, and leaves the session terminated.

Verified with:

go test ./internal/session_manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ao session kill returns INTERNAL_ERROR for exited (terminated=false) sessions, and cleanup cannot reach them

1 participant