fix(cli): broker init through a connectable daemon socket - #1874
Merged
Merged
Conversation
`tracedecay init` gated brokered initialization on `daemon_reachable()`, which requires a daemon to answer initialize within a one-second reachability probe. A cold daemon on a CPU-constrained host answers later than that, so init refused with `code_index_scheduler_unavailable` and told the operator to start a daemon that was already accepting on its socket. Reproduced on the PR dogfood journey under a 4 vCPU cgroup: one run of two failed at `phase=init` after 1.4 s while the harness daemon was up. The identity proof was never the precondition init needed. `brokered_init` already carries its own 120 s bootstrap deadline for exactly this case, so a connectable socket is enough to broker; a missing or stale socket still refuses with the same message. `daemon_socket_connectable` reports the socket observation `daemon_readiness_probe` already computes and discards, so no timeout or budget constant changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
tracedecay initgated its brokered path ondaemon_reachable(), which requires a completed initialize handshake inside a one second probe. A cold daemon under CPU pressure answers later than that, so init told the operator to start a daemon that was already serving its socket, withcode_index_scheduler_unavailable. Reproduced on the first of two runs of the dogfood journey at 4 vCPU (taskset -c 0-3inside a 400% CPU quota scope), failing atphase=initafter 1.4 s.daemon_readiness_probealready classifies the socket asConnectablebefore the handshake and the caller discarded that observation. Init now brokers ondaemon_socket_connectable();brokered_initalready carries its own 120 s bootstrap deadline for this case, and missing or stale sockets still refuse with the unchanged message. No timeout moved.daemon_socket_connectable_separates_a_slow_daemon_from_no_daemonbinds a listener that never answers initialize and asserts thatdaemon_reachable()is false there whiledaemon_socket_connectable()is true, with missing and stale sockets still false for both.From the same re-verification: the resident-memory admission problem recorded on 2026-08-28 does not reproduce.
reserve_worker_memoryasks formin(workers, memory_safe_worker_count) * 128 MiB, which is 8.3% of the 6 GiB authority on a 4 vCPU host, and the regression test for it entered master with #707 on 2026-09-17; the note was written while that fix was reverted.🤖 Generated with Claude Code