Skip to content

refactor: make wrapper daemon ownership explicit - #241

Draft
ejgallego wants to merge 7 commits into
mainfrom
codex/daemon-owner-lifetime
Draft

refactor: make wrapper daemon ownership explicit#241
ejgallego wants to merge 7 commits into
mainfrom
codex/daemon-owner-lifetime

Conversation

@ejgallego

@ejgallego ejgallego commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

This PR makes wrapper daemon ownership explicit so daemon lifetime is tied to a deliberate lean-beam ensure --hold session instead of inferred from per-request leases. This removes the lease, heartbeat, revocation, and retirement protocol while giving wrapper commands deterministic attachment and shutdown behavior.

  • Only lean-beam ensure --hold starts and owns a wrapper daemon; ordinary commands attach to that session and report a direct recovery command when no owner exists.
  • The holder owns the daemon through an inherited stdin pipe. Holder exit closes the pipe and stops admission, cancels active requests, shuts down backend sessions, and exits the daemon.
  • Explicit shutdown removes only the matching registry generation, which tells the holder to close its ownership pipe; typed admission closure ensures backend teardown happens once under shutdown races.
  • Registry generation, endpoint, root, and PID-domain validation remain fail-closed, while MCP keeps its independent stdio-owned lifetime.

@ejgallego
ejgallego force-pushed the codex/daemon-owner-lifetime branch 4 times, most recently from b63f8ab to d5a4e22 Compare August 24, 2026 16:03
@ejgallego
ejgallego marked this pull request as ready for review August 24, 2026 16:10
@ejgallego
ejgallego force-pushed the codex/daemon-owner-lifetime branch 4 times, most recently from 8fe274a to 5556640 Compare August 25, 2026 16:45
@ejgallego
ejgallego force-pushed the codex/daemon-owner-lifetime branch from 5556640 to e7a96eb Compare August 25, 2026 18:18
@ejgallego
ejgallego marked this pull request as draft August 25, 2026 18:50
@ejgallego ejgallego changed the title fix: fence daemon lifetime to active wrapper requests refactor: make wrapper daemon ownership explicit Aug 25, 2026
@ejgallego
ejgallego force-pushed the codex/daemon-owner-lifetime branch from 1b579a7 to 7ae0af4 Compare August 25, 2026 20:35
@ejgallego
ejgallego force-pushed the codex/daemon-owner-lifetime branch from 7ae0af4 to 184ed18 Compare August 25, 2026 21:00
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