Launch bug hunters as native panes instead of a raw tmux split - #1228
Merged
Conversation
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.
Summary
Find bugs→Launch huntersfailed on a native-backed task withFailed to split pane: error connecting to /private/tmp/tmux-501/ (Socket operation on non-socket).Root cause:
spawnBugHuntersInTaskcalledtmux.splitWindowunconditionally againstdev3-task-<id>onpty.getSessionSocket(taskId). A native task has no tmux session, andgetSessionSocketfalls back toDEFAULT_TMUX_SOCKET— so the launch probed the default tmux socket directory and died. A leftover tmux-only split, same family as the aux-pane fix in seq 1376.What changed
src/bun/task-aux-panes.ts— extracted the backend-neutral primitivesplitTaskPane()(pluscloseTaskPane()) out ofopenAuxPane(). It takes an explicittmuxTarget/nativeAnchor/restoreFocus, so callers that split off a pane (not the session) work on both backends.openAuxPane()is nowcloseAuxPane+splitTaskPane; dev-server and git panes are unchanged.src/bun/rpc-handlers/tmux-pty.ts— bug hunters go throughsplitTaskPane(). On native: real coordinator panes, the prompt delivered viasendPromptToNativePane()(which resolves the pane's writer lease) instead oftmux send-keys, focus handed back to the agent's pane, and nosessionState.paneswrite (that registry is the tmux one — a native entry would be a permanent phantom). A native launch that cannot open every hunter closes the panes it already opened and throws, instead of silently half-starting.sessionStatebookkeeping and two-step send-keys delivery; a mid-way tmux split failure still continues with the remaining hunters.Verification
handlers.spawnBugHuntersInTaskon a native task: N panes opened with the right anchors, zero process spawns (so no tmux call and no default-socket probe), prompt delivered natively, rollback on a failed later split, honest error when the terminal is not running, nosessionStatewrite.Find bugsdialog: default count launches with the picker's defaults, and a backend failure is shown instead of closing the dialog.pane-2/3/4stacked beside the agent'spane-1, all three got the[bug-hunt]prompt, focus stayed onpane-1, no console errors, and no tmux session on either socket.