Skip to content

fix(cli): broker init through a connectable daemon socket - #1874

Merged
ScriptedAlchemy merged 1 commit into
masterfrom
fix/perf-admission-reverify
Sep 20, 2026
Merged

ScriptedAlchemy merged 1 commit into
masterfrom
fix/perf-admission-reverify

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

tracedecay init gated its brokered path on daemon_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, with code_index_scheduler_unavailable. Reproduced on the first of two runs of the dogfood journey at 4 vCPU (taskset -c 0-3 inside a 400% CPU quota scope), failing at phase=init after 1.4 s.

daemon_readiness_probe already classifies the socket as Connectable before the handshake and the caller discarded that observation. Init now brokers on daemon_socket_connectable(); brokered_init already 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_daemon binds a listener that never answers initialize and asserts that daemon_reachable() is false there while daemon_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_memory asks for min(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

`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>
@changeset-bot

changeset-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9dfacab

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T03:32:18.361533Z 9dfacab PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ScriptedAlchemy
ScriptedAlchemy merged commit 2af65b1 into master Sep 20, 2026
25 checks passed
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