Conversation
Session cleanup was implicit and depended on tmux exiting on its own, which left lifecycle completion ambiguous and could strand tmux sessions after successful or failed runs. This change adds an explicit session finalization step in DaniService, records when and why a session ended, and teaches OmxRunner how to kill an existing tmux session safely. Tests now cover both successful and failed finalization paths as well as the low-level tmux close behavior. Constraint: Must preserve the existing omx resume flow that uses omx_session_id across fresh tmux shells Rejected: Full stage lifecycle state machine | too broad for the issue and unnecessary to stop stray tmux sessions Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep tmux cleanup centralized in service finalization so future lifecycle changes do not duplicate termination logic Tested: python -m pytest -q; python -m ruff check . Not-tested: Real tmux + omx integration against a live GitHub event stream
Merged
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
DaniServiceso completed and failed jobs actively close their tmux sessionended_at,termination_reason) for lifecycle visibilityWhy
Issue #4 is satisfied under the
omx resumeinterpretation of lifecycle: the durable context lives inomx_session_id, while tmux is only the temporary execution shell. That means we should close tmux after each run and recreate a fresh tmux shell on resume, rather than leave stray tmux sessions behind.Validation
python -m pytest -qpython -m ruff check .Closes #4