Repository navigation
feat(agentcore): add session ownership and lifecycle control - #95
Merged
Fodesu merged 1 commit intoOct 3, 2026
Merged
Conversation
Fodesu
force-pushed
the
feat/agent-runtime-core-22-owner
branch
2 times, most recently
from
October 3, 2026 14:55
068148c to
f05828e
Compare
Fodesu
force-pushed
the
feat/agent-runtime-core-22-owner
branch
from
October 3, 2026 15:35
f05828e to
d9b6b68
Compare
Fodesu
marked this pull request as ready for review
October 3, 2026 16:23
Fodesu
force-pushed
the
feat/agent-runtime-core-22-owner
branch
from
October 3, 2026 17:04
d9b6b68 to
5d6c2c9
Compare
Fodesu
force-pushed
the
feat/agent-runtime-core-22-owner
branch
from
October 3, 2026 17:11
5d6c2c9 to
a9be054
Compare
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
Adds session ownership and lifecycle coordination in
agentcore/owner. The owner is the process-level authority that opens a session, establishes an epoch, serializes commands for that session, and coordinates Turn/Run work without absorbing the responsibilities of the ledger projections or executor.Design
Ownership is represented by an epoch-fenced lifecycle. A current owner may process commands and commit through its Writer; a stale owner cannot continue appending after takeover. The owner-facing handle exposes the session’s durable state and routes accepted commands through the appropriate domain command helpers, so input submission, Turn start/stop, compaction, and recovery retain their existing CommitID and projection invariants.
The lifecycle path distinguishes an idle session from one with pending inbox work or active execution. Activation drains durable commands in sequence, resolves each command as applied or rejected, and keeps routing an optimization rather than a delivery prerequisite. Owner shutdown releases local coordination without deleting the inbox or rewriting Run state. Reopening the same session therefore resumes from committed facts and unresolved commands rather than from process memory.
Fork checks are delegated to history and projections: a fork cannot silently inherit an active execution at an unsafe boundary, and a child retains inherited facts according to the session stream rules. The owner also keeps the one-writer critical section around state-dependent command construction, allowing guards such as “no active Turn” to be checked against the same view that is committed.
Testing
The lifecycle-internal tests cover owner activation and release behavior, fencing/ownership transitions, and the single-owner assumptions used by the handle.