Repository navigation
Conversation
This was referenced Oct 27, 2026
Collaborator
Author
|
This moved to the monorepo as anomalyco/opencode#59701 (merged) and was released in |
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
poll(2)on the listener plus a private wake channel (UnixStream::pair, non-blocking,CLOEXEC) instead of a 10 ms sleep. The timeout is the minimum of the next ownership deadline, a 2 s safety net, and the accept back-off.Controlnotifies under the ownership mutex for every stop/ownership mutation.Control::tickdrains the wake channel, observes, detects missed wakes, and ticks under the same lock, so a missed wake is detected deterministically (a warning in release builds; an error in debug builds, with cleanup still running).EMFILE,ENFILE,ENOBUFS,ENOMEM) from accept or cancellation now pause accept for 100 ms instead of killing the daemon.WaitForMultipleObjectson the connect event plus a stop event, and replacing the per-terminal 10 ms root-exit poll.Measurement (macOS, debug builds, idle owned daemon)
Tests added
src/daemon/server.rs:owned_handoff_expiry_keeps_daemonidle_loop_does_not_spinconnect_does_not_wait_for_timeouthandler_completion_closes_socket_promptlymissed_wake_is_detectedmissed_disconnect_is_detectednotify_storm_is_not_missedsrc/ownership.rs:deadline_tracks_each_statesrc/transport/unix.rs:wake_is_cloexec_and_nonblockingwake_notify_never_blocks_and_drain_emptieslistener_wait_reports_each_sourcelistener_wait_rounds_timeout_upMutation checks
Done) notify failshandler_completion_closes_socket_promptly.update_ownershipnotify failsowned_handoff_expiry_keeps_daemon.ticknotify failsidle_loop_does_not_spin,missed_wake_is_detected, andmissed_disconnect_is_detected.Flakiness runs
Validation
cargo fmt --checkandcargo clippy --locked --all-targets --all-features -- -D warningspass (toolchain 1.90.0).cargo test --locked --lib --test service --test runtime --test ownership --test rows --test ghostty-effects(lib 59, ghostty-effects 5, ownership 8, rows 1, runtime 8 + 1 ignored, service 9).-D warningspasses forx86_64-pc-windows-msvcandx86_64-unknown-linux-gnu(--all-targets --all-features, ghostty-vt link libs stubbed). Native Windows and Linux are verified by CI.