Repository navigation
refactor(sessions): unify in-memory turn, queue, and stop ownership - #162433
Closed
roboclaw-bot wants to merge 1 commit into
Closed
roboclaw-bot wants to merge 1 commit into
roboclaw-bot wants to merge 1 commit into
Conversation
Worked on by: - @jalehman Co-authored-by: jalehman <[email protected]> OpenClaw-Publication: 280d4aaa-a70a-4ff0-a028-499a3e7486af
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
This was referenced Oct 1, 2026
Closed
This was referenced Oct 3, 2026
Merged
Contributor
|
Superseded by #165957, which carries this work forward on |
This was referenced Oct 6, 2026
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.
Related: #160737
What Problem This Solves
Session turns, queued inputs, cancellation and mutations rely on overlapping owners, making it difficult to keep stale callbacks and unfinished cleanup from interfering with the next turn.
User Impact
The intended outcome is consistent ordering and cancellation across channel, Gateway, native and scheduled work, with successors and mutations waiting for the correct outstanding work to settle.
Draft for design/code review, not merge-ready. Full latest-source reply E2E and some isolated integration proof remain incomplete. This is a broad in-memory ownership cutover, not a claim of measured performance or maintenance-time improvement.
No SQLite schema change: no tables/columns, schema-version bump or migration; no durable mailbox is introduced. Existing persisted write/delete formats remain, but their admission and cleanup ordering change, including session deletion, maintenance preservation, startup orphan checks and delivery enqueue admission.
Why This Change Was Made
Extend the existing reply-operation owner into a physical-session controller rather than add another scheduler:
The goal is correctness and maintainability, not a net line reduction. The implementation is larger and still uses imperative mailbox/lifecycle/Stop modules around a narrower pure phase/outcome reducer.
Umbrella issue coverage
“Addressed” below means implementation is present in this draft, not that each issue's full acceptance criteria are complete. No issue is auto-closed.
Not addressed: #160745, the separately reviewed durable mailbox / restart-persistence stage. No SQLite schema work is included.
Evidence
Current focused evidence after pre-publication review corrections:
Known gaps / failures:
Review navigation and size context
Start with
docs/concepts/session-controller.md, then the controller state/mailbox, lifecycle/Stop and native attachment boundaries. The diff mixes ownership changes, caller migration and fixture changes; it is not 925 independent features.Pre-publication path inventory (rename sides counted separately): 925 paths, including 96 untracked replacement files; +40,696 / -32,903, net +7,793. Filename-classified runtime: +18,923 / -15,203, net +3,720; tests/fixtures: +21,498 / -17,683, net +3,815. These are not GitHub's rename-aware display counts or a complexity/correctness score. The original estimate used a different baseline.
Worked on by
Work sessions
View the OpenClaw team session