Repository navigation
fix(pi): report blocked to herdr while a revdiff review is open - #410
Merged
Merged
Conversation
revdiff_review ran revdiff through spawnSync, which froze pi's event loop for the whole review. The herdr pi integration sends its state over a socket on a later loop turn, so a blocked report could never reach herdr while the review was open, and herdr showed the agent as working until revdiff exited. The review now runs through an async spawn, the way pi runs its own external editor, and with HERDR_ENV=1 the tool emits herdr:blocked around it. The tool is marked sequential because the frozen loop was what kept parallel tool calls off the terminal during a review. A process exit hook sends SIGTERM to revdiff, so a pi shutdown in the middle of a review does not leave it running. Fixed #318
spawn reports only EACCES, EAGAIN, EMFILE, ENFILE and ENOENT as an error event and throws the rest. A revdiff binary the OS cannot run, such as a wrong-architecture build, failed with ENOEXEC after tui.stop(), so pi stayed unresponsive and the tool surfaced a raw exception. The throw now resolves as the same launch error the event path reports. Related to #318
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.
revdiff_reviewran revdiff throughspawnSync, which froze pi's event loop for the whole review. The herdr pi integration sends its state over a socket on a later loop turn, so herdr showed the agent as working until revdiff exited.The review now runs through an async
spawn, the way pi runs its own external editor, and withHERDR_ENV=1the tool emitsherdr:blockedaround it. The tool is markedexecutionMode: "sequential"because the frozen loop was what kept parallel tool calls off the terminal. A process exit hook sends SIGTERM to revdiff if pi shuts down mid-review, and a spawn error thrown synchronously (ENOEXEC for a binary the OS cannot run) takes the same launch-error path as the async ones.The delivery test uses a real unix socket: the fake revdiff waits for the blocked payload to arrive, so it fails if the review blocks the loop again.
Follows the timing discussion in #319.
Fixed #318