Repository navigation
Keep fake Codex task alive through delivery test claim handoff - #1104
Merged
Merged
Conversation
max-sixty
pushed a commit
that referenced
this pull request
Sep 24, 2026
The everyday test in [main CI run 35977934891](https://github.com/max-sixty/leaf/actions/runs/35977934891) failed because its fake Codex task exited before the page claim moved to the pytest process. In that gap, the detached delivery carrier could see a dead owner and exit. The same setup race was fixed for two neighboring tests in #1104; this test still used the earlier order. Hold the fake task until the carrier starts and the claim transfers, then let the starting command exit before checking queued delivery and the turn-ended stamp. The assertions still exercise delivery after the command ends. Verified: the four focused Codex cases pass, and pre-commit passes on the changed file. Co-authored-by: leaf-agent <[email protected]>
max-sixty
pushed a commit
that referenced
this pull request
Sep 24, 2026
The nightly Codex transport test could lose its detached carrier before checking the requested transport: its fake task exited before the page claim transferred to pytest. Hold that task until the carrier starts and the claim moves, then let the starting command exit before asserting that a later start reports the running transport. This applies the same claim handoff used by the neighboring delivery tests in #1104. The [failed nightly run](https://github.com/max-sixty/leaf/actions/runs/35981383445) reported a missing App Server socket instead of the expected transport diagnostic. The focused transport test and pre-commit pass locally. Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 5, 2026
…#1798) #1774 removed the polling loop that held `under_codex`'s fake Codex task, and every SIGKILL in `tests/`. This change tells the next author the rule that loop broke, and adds a test so the suite rejects SIGKILL again. The loop came from a `tend-ci-fix` run that opened #1104. The section "A process the suite starts ends with the run" in `tests/AGENTS.md` only said which fixture owns each resource. The change did take its process from `spawn`, and two reviews read that as proof of cleanup: "the fixture closes surviving processes on failure". `spawn` only ended the runner, though, so its shell survived. - **`tests/AGENTS.md`** now states the property itself, as checks you can run: - Many suite runs share one machine, so a process a test starts ends on every way out of the test. `spawn`'s teardown ends a child and its group on a pass, failure or interrupt. A worker that dies runs no teardown, so a process that would otherwise run on carries its own link to the worker: the session claim for a page server, the worker's pipe for a held process. - A held process blocks on a pipe the worker holds, as `session_process` does. It never polls for a file the test body has yet to write. - A test ends a process with SIGTERM or by closing that pipe, never SIGKILL. - To check a new held process: make the test fail right after starting it, then run `pgrep -fl <tmp_path>`. On the pre-#1774 tree that finds the leaked shell; on #1774 it finds nothing. - **`test_no_test_ends_a_process_with_sigkill`** reads `tests/*.py` and fails on `Popen.kill()`, `signal.SIGKILL`, signal 9 passed to `kill`, `killpg` or `send_signal`, or a shell `kill -9` / `kill -KILL`. Each form planted in a scratch test made it fail, naming the line, and `os.kill(pid, 0)` still passes. I scored the guidance with and without the new text: | Scenario | Without | With | |---|---|---| | Codex reviewing #1104 in a checkout at its base: flags the leak | 4/6 | 4/6 | | Those reviews: ask for a pipe hold that ends with the worker (instead of a `finally` that keeps the poll) | 0/4 | 4/4 | | Writing a crashed-lease-holder test: avoids SIGKILL | 0/3 | 3/3 | | Writing a session stand-in: blocks on a worker-held pipe | 1/3 | 3/3 | | Reviewing a correct pipe-held test: no false process findings | clean | clean | The guidance doesn't make a reviewer notice the leak more often. What stops it now is #1774's change to `spawn`; the guidance shapes how the fix is written. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
The two Codex delivery failures in main CI run 35972927203 come from the test harness letting its fake Codex task exit before transferring the page claim to the pytest worker. In that gap, the detached adapter can see no live owner and exit, or treat the offline sibling as the only remaining page.
The shared
under_codexfixture can now hold the fake task until a test releases it. Both affected tests wait for the adapter lease, transfer the claim while the task is alive, then let the starting command end. This makes the process lifetime in the test match the Codex task it models while preserving the assertions about delivery after the command ends.Verified: the five focused Codex cases pass with two pytest workers, and pre-commit passes on both changed files.