Repository navigation
fix: make event observers durable and detect closed readers - #222
Draft
schickling-assistant wants to merge 1 commit into
Draft
schickling-assistant wants to merge 1 commit into
schickling-assistant wants to merge 1 commit into
Conversation
agent-identity: agent/dotfiles/fractal-product-lead agent-persona: generalist agent-supervisor: unavailable agent-tool: OMP agent-tool-version: 18.12.5 agent-runtime: OMP 18.12.5 agent-model: openai-codex/gpt-6.1-sol
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.
Problem
Observers can miss an event emitted before subscription or remain alive after a pipeline reader closes. Lifecycle-only replay does not cover arbitrary event types, stale retained events need an incarnation fence, and vanished targets must not be mistaken for a match or timeout.
Goal and decisions
Session "NAME" vanished without a recorded exit.on stderr. Matchedevents --wait TYPE [-t SECONDS] [--json] NAMEexits 0; a deadline or other error exits 1. The new 2 is a CLI contract change, not success.Overlapping prior work
See #201 by @schickling-assistant (Compounding Manager), exact head
171c1d23e214706d2ed9e33638749e3e6823630d, branchagent/pty-events-wait-busy-spin. Its lifecycle-only vanished behavior reports exit 1 when a subscribed daemon disappears. This PR includes prompt lifecycle disappearance detection and extends it to all wait types, changes vanished to distinct exit 2, adds incarnation fencing/general retained replay, and fixes closed idle output. #201 remains untouched; a maintainer should decide which draft supersedes the other.Dotfiles caller audit for the exit-code change
Repository-wide literal and constructed-argv searches found no
pty events --waitcode caller and no caller that branches on exactly exit 1. Exit-status consumers found:nixpkgs/home-manager/modules/tmux/resilience.py:retained_heads()invokesevents --recent --json --type user.tmux.snapshot; itspty()/run()wrapper rejects any nonzero return code.nixpkgs/home-manager/modules/tmux/default.nix: retained-owner verification uses a negatedevents --recent/jq pipeline and treats any failure as failure.nix/checks/tmux-runtime/suite.nix:recent_events()maps any nonzero return to an empty result; shell recent-event assertions use the suite's fail-on-error pipeline behavior.nix/checks/tmux-runtime/performance.nix: recent-event assertions use fail-on-error pipelines.These invoke
--recent, whose exit contract is unchanged; none interprets the changed wait outcome. Fractal drawer/input/story fixtures only display follow command strings, not execute or inspect their exit codes. Historical documentation contains observer examples, not exit-code-consuming callers.Verification
Final-head build-lane ticket submitted for
cargo test -p ptyandcargo clippy -p pty --all-targets -- -D warnings; result pending. Regression coverage includes retained exits, exits during waits, arbitrary exact types beyond the recent tail, stale-generation fences, removed/vanished sessions, and bounded idle-reader closure in text and JSON. No CI dispatch and no installed binary change.Complexity, concerns, follow-ups
Reuses the existing event follower and registry liveness classifier; no new dependency or daemon protocol. CLI users relying on vanished status 1 must accommodate status 2. No compatibility alias is added. No additional follow-up implementation is required.
Posted on behalf of @schickling
agent_identitysessionagent_personaagent_supervisoragent_toolagent_tool_versionagent_runtimeagent_modelworktree