fix(subagents): close cancelled startup and preserve current progress evidence - #429
Merged
Conversation
This was referenced Sep 7, 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.
Problem
Cancelling child startup could leave a late Pi session alive or an empty Workflow worktree behind. Large tool output also hid newest failure evidence and made every live preview split content the UI never displayed. Reproduced on main after #426; fixes #428.
Value
Cancellation retains cleanup ownership, recent failures remain visible under transcript pressure, and live tool previews avoid unnecessary allocations. Existing permissions, configuration and canonical Pi messages remain unchanged.
Approach
Validation
bun run checkpassed; standardbun run testpassed 1446 Node tests with one platform skip and Vitest 30/30. Two independent reviews found no remaining issues after the worktree interruption classification refinement. Deterministic regressions cover delayed session factory/bind cancellation, real Git post-checkout cancellation, dirty-work preservation, byte-pressure final errors and preview allocation behavior. Local diagnostic preview measurements and limitations are recorded in the research document; they are not application-wide speedup claims.Exact-head remote CI passed on
342ac927736b64d12c8953e0c4c932eedecb3451: Node 22, Node 24 and Windows. Fixed review base:eaf470bab4ac2dda607d16c6ddee66dc35367527.Impact
No new model tools, permissions, settings or persisted schema. Display selection under byte pressure now prioritizes the latest evidence. Cancellation cleanup follows existing empty/dirty/uncertain worktree policy. An interrupted ordinary startup may intentionally retain an empty checkout until its asynchronous work is known to have stopped; the error reports its path and branch. User runtime and role files were preserved. This PR is for review and will not be merged automatically.
Investigation: child acquisition and progress audit. Viewport/history/shell and unrelated Cursor large-frame copying are outside this bounded repair.