Repository navigation
Report each failed daemon start's own error - #100
Merged
Merged
Conversation
Every start of a store appends to its one log. serve now names its pid on its error line, written in one write, and the launcher reads only lines past its spawn from its own child. Without one it is daemon_start_failed naming the log. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01L9TT37y1798majTjQbUtZW
|
You have reached your Codex usage limits for security reviews. Please try again later. |
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 was referenced Oct 10, 2026
Merged
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.
Before: every auto-start of a store appends to the store's one log, and the launcher read the log's last line as its own child's error. When two starts of the same store failed at the same moment, one command could report the other's error.
After:
serveadds itspidto its error line and writes it in a single write. The launcher reads only what was appended after its own spawn and takes the last line carrying its child's pid. A child that exits without such a line isdaemon_start_failed, and the detail names the log.This is the follow-up George asked for on the declined #94 finding (comment, listed in #96). It sets no defaults.
How
main.rs:report()addspidwhen the process isserveand writes the line with onewrite_all, so concurrent writers to the append-mode log never interleave inside a line.client.rs:ensure_daemonrecords the log's length before spawning.child_failurereads from there and picks the last JSON line whosepidmatches the child, then dropspidfrom the reported error.docs/CLI.mdsays so.test_cli: eight concurrent failed starts per error, two different errors on one store, and each launcher must report its own.Performance
Wall time of
agent run --detach --newauto-starting a daemon, median of 20 runs (IQR), Linux. Before is main at e3454e3, after is this branch. The script is in the ignored local directory.The good path adds one
fstaton the log. The failed path reads only the bytes past the spawn instead of the whole log, so a long log no longer makes a failed start slower.Checks
cargo fmt --check.cargo clippy -p agent-runtime -p agent-client --all-targets -- -D warnings.cargo test -p agent-runtime -p agent-client: all pass.AGENT_TEST_RUNTIME=1 python3 -m unittest discover -s tests: 421 tests, OK (44 skipped).node --test app/tests/state.test.cjs: 187 pass.🤖 Generated with Claude Code