8000 feat(agentcore): add session ownership and lifecycle control by Fodesu · Pull Request #95 · felinics/twilight · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /react-partial>

feat(agentcore): add session ownership and lifecycle control - #95

Merged
Fodesu merged 1 commit into
feat/agent-runtime-core-21-runtimefrom
feat/agent-runtime-core-22-owner
Oct 3, 2026
Merged

Fodesu merged 1 commit into
feat/agent-runtime-core-21-runtimefrom
feat/agent-runtime-core-22-owner

Conversation

@Fodesu
@Fodesu Fodesu commented Oct 3, 2026 •
Copy link
Copy Markdown
Member

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.

@Fodesu
Fodesu added this pull request to stack #105 October 3, 2026 12:27
@Fodesu Fodesu changed the title feat/agent runtime core 22 owner feat(agentcore): add session ownership and lifecycle control Oct 3, 2026
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-22-owner branch 2 times, most recently from 068148c to f05828e Compare October 3, 2026 14:55
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-22-owner branch from f05828e to d9b6b68 Compare October 3, 2026 15:35
@Fodesu
Fodesu removed this pull request from stack #105 October 3, 2026 16:13
@Fodesu
Fodesu added this pull request to stack #107 October 3, 2026 16:16
@Fodesu
Fodesu marked this pull request as ready for review October 3, 2026 16:23
@Fodesu
Fodesu removed this pull request from stack #107 October 3, 2026 16:34
@Fodesu
Fodesu added this pull request to stack #108 October 3, 2026 16:37
@Fodesu
Fodesu removed this pull request from stack #108 October 3, 2026 16:51
@Fodesu
Fodesu added this pull request to stack #110 October 3, 2026 16:55
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-22-owner branch from d9b6b68 to 5d6c2c9 Compare October 3, 2026 17:04
@Fodesu
Fodesu force-pushed the feat/agent-runtime-core-22-owner branch from 5d6c2c9 to a9be054 Compare October 3, 2026 17:11
@Fodesu
Fodesu merged commit d99b2ab into main Oct 3, 2026
8 checks passed
@Fodesu
Fodesu deleted the feat/agent-runtime-core-22-owner branch October 5, 2026 07:35
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.

1 participant

0