Skip to content

ClaudeSession.prompt: skip control_request on fresh subprocess (fixes set_status hang)#494

Merged
FidoCanCode merged 1 commit into
mainfrom
fix-session-prompt-control-interrupt-hang
Apr 14, 2026
Merged

ClaudeSession.prompt: skip control_request on fresh subprocess (fixes set_status hang)#494
FidoCanCode merged 1 commit into
mainfrom
fix-session-prompt-control-interrupt-hang

Conversation

@FidoCanCode
Copy link
Copy Markdown
Owner

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.

Drop the control_request + drain dance entirely. The _cancel signal + _lock hand-off already guarantee the previous holder's iter_events has 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).

@FidoCanCode FidoCanCode requested a review from rhencke April 14, 2026 20:05
@FidoCanCode FidoCanCode force-pushed the fix-session-prompt-control-interrupt-hang branch from 8e5de26 to 0bbd458 Compare April 14, 2026 20:08
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).
@FidoCanCode FidoCanCode force-pushed the fix-session-prompt-control-interrupt-hang branch from 0bbd458 to 3a4ad52 Compare April 14, 2026 20:12
@FidoCanCode FidoCanCode merged commit 82d7b9a into main Apr 14, 2026
2 checks passed
@FidoCanCode FidoCanCode deleted the fix-session-prompt-control-interrupt-hang branch April 14, 2026 20:17
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.

2 participants