ClaudeSession.prompt: skip control_request on fresh subprocess (fixes set_status hang)#494
Merged
Merged
Conversation
rhencke
approved these changes
Apr 14, 2026
8e5de26 to
0bbd458
Compare
set_status's first session.prompt call on a freshly-spawned subprocess hung indefinitely. prompt() was sending a stream-json control_request interrupt before the user message and then draining with consume_until_result. On a fresh subprocess with no in-flight turn, claude ignores the control_request and never emits a type=result — the drain blocks forever. The cancel signal + lock hand-off already guarantees the previous holder's iter_events has exited and released the session. There is nothing in-flight to interrupt. Drop the control_request + drain dance entirely; acquire the lock, maybe switch model, send the user message, drain for our turn's result. Unblocks set_status on repos that just started up with no prior turn history (every kennel restart).
0bbd458 to
3a4ad52
Compare
rhencke
approved these changes
Apr 14, 2026
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.
set_status's firstsession.promptcall on a freshly-spawned subprocess hung indefinitely.prompt()was sending a stream-jsoncontrol_requestinterrupt before the user message and then draining withconsume_until_result. On a fresh subprocess with no in-flight turn, claude ignores the control_request and never emits atype=result— the drain blocks forever.Drop the control_request + drain dance entirely. The
_cancelsignal +_lockhand-off already guarantee the previous holder'siter_eventshas exited and released the session — there's nothing in-flight to interrupt.Unblocks set_status on repos that just started up with no prior turn history (i.e. every kennel restart).