Fix owner eviction, stuck cleanup, and unpublished completed work - #9
Merged
Merged
Conversation
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.
Long-running workers could finish after OpenCode evicted the automation owner, leaving changes unpublished and the reloaded plugin failed with a held lock. The 0.6.2 plugin-list heartbeat did not refresh OpenCode's session-activity timer, and the affected in-process SDK adapter ignores AbortSignal.
Use durable activity on one empty maintenance session per owner, without prompting a model or touching work sessions. Bound local SDK waits and RPC disposal, allow retiring locks to be released before reacquisition, and preserve healthy workers for reconciliation by their saved session ID. Reject checkpoint writes queued after shutdown.
Validation: CI passed on Node 22 and 24 (143 tests, lint, typecheck, build, package installation). Coverage includes the new eviction-to-publication regression and real lock handoff. The regression models an SDK wait that ignores cancellation and checks that the replacement publishes once without another prompt.
Production recovery: issue wiiii653/yoomp-#18 was backed up, rebuilt, verified with 134 passing CTest tests, and published as wiiii653/yoomp-#19. This branch's package was deployed as an emergency hotfix; it is not an official release. Both configured owners report active, polling succeeds with zero failures, activity RPC responds, and the server emitted a durable session.renamed event carrying the correct owner location.
The maintenance session is visible in session history as Automation owner keepalive, has no messages, and consumes no model tokens. Keepalive requires the matching registered background service; standalone instances retain that limitation.