Repository navigation
fix: let codex-wake-on-exit hand a flow to a new thread - #533
Merged
Merged
Conversation
A watcher run can only wake the thread that armed it, because its callback is queued to that thread ID. The skillette told agents to retain "an owned live watcher" without saying what owned meant. When a new thread picked a flow up from its durable log, the helper refused the old run as foreign and gave it no way forward, so agents checked the PIDs with ps and kept the old thread's watcher. Its callback then went to a thread nothing had loaded, and the flow stalled silently. A baseline eval reproduced this in both trials where the old watcher was still live. Ownership is now the manifest's thread ID and nothing else, status reports on any thread's run, and supersede is the one cross-thread action: it cancels the old watcher and marks the run as taken. The old owner's ack and the successor's supersede race for the same exclusive claim file, because a queued callback does reach an unloaded exec thread once that thread is resumed, and without the claim both threads would act on the same run. The first candidate showed a second problem: a manually resumed old owner took the flow back from its successor in 2 of 4 trials. A thread whose run was superseded now asks the user before doing any flow work. Two threads the user runs on the same flow at the same moment are still not serialized; the helper can only arbitrate claims on a run, not work a live thread has already started, so the skillette states that as a limit.
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.
A watcher run can only wake the thread that armed it, because its
callback is queued to that thread ID. The skillette told agents to
retain "an owned live watcher" without saying what owned meant. When a
new thread picked a flow up from its durable log, the helper refused
the old run as foreign and gave it no way forward, so agents checked
the PIDs with ps and kept the old thread's watcher. Its callback then
went to a thread nothing had loaded, and the flow stalled silently. A
baseline eval reproduced this in both trials where the old watcher was
still live.
Ownership is now the manifest's thread ID and nothing else, status
reports on any thread's run, and supersede is the one cross-thread
action: it cancels the old watcher and marks the run as taken. The old
owner's ack and the successor's supersede race for the same exclusive
claim file, because a queued callback does reach an unloaded exec
thread once that thread is resumed, and without the claim both threads
would act on the same run.
The first candidate showed a second problem: a manually resumed old
owner took the flow back from its successor in 2 of 4 trials. A thread
whose run was superseded now asks the user before doing any flow work.
Two threads the user runs on the same flow at the same moment are still
not serialized; the helper can only arbitrate claims on a run, not work
a live thread has already started, so the skillette states that as a
limit.