Skip to content

Launch bug hunters as native panes instead of a raw tmux split - #1228

Merged
h0x91b merged 3 commits into
mainfrom
fix/dev3-native-bug-hunter-panes
Aug 2, 2026
Merged

Launch bug hunters as native panes instead of a raw tmux split#1228
h0x91b merged 3 commits into
mainfrom
fix/dev3-native-bug-hunter-panes

Conversation

@h0x91b

@h0x91b h0x91b commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

Find bugsLaunch hunters failed on a native-backed task with Failed to split pane: error connecting to /private/tmp/tmux-501/ (Socket operation on non-socket).

Root cause: spawnBugHuntersInTask called tmux.splitWindow unconditionally against dev3-task-<id> on pty.getSessionSocket(taskId). A native task has no tmux session, and getSessionSocket falls back to DEFAULT_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 primitive splitTaskPane() (plus closeTaskPane()) out of openAuxPane(). It takes an explicit tmuxTarget / nativeAnchor / restoreFocus, so callers that split off a pane (not the session) work on both backends. openAuxPane() is now closeAuxPane + splitTaskPane; dev-server and git panes are unchanged.
  • src/bun/rpc-handlers/tmux-pty.ts — bug hunters go through splitTaskPane(). On native: real coordinator panes, the prompt delivered via sendPromptToNativePane() (which resolves the pane's writer lease) instead of tmux send-keys, focus handed back to the agent's pane, and no sessionState.panes write (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.
  • tmux tasks keep the identical split geometry, sizes, sessionState bookkeeping and two-step send-keys delivery; a mid-way tmux split failure still continues with the remaining hunters.

Verification

  • New backend regressions through handlers.spawnBugHuntersInTask on 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, no sessionState write.
  • New renderer regressions entering through the actual Find bugs dialog: default count launches with the picker's defaults, and a backend failure is shown instead of closing the dialog.
  • Existing tmux bug-hunter suite passes untouched.
  • Live native UI QA: scratch native task → Find bugs → Launch hunters (default 3) → pane-2/3/4 stacked beside the agent's pane-1, all three got the [bug-hunt] prompt, focus stayed on pane-1, no console errors, and no tmux session on either socket.

@h0x91b
h0x91b merged commit eee53a8 into main Aug 2, 2026
9 checks passed
@h0x91b
h0x91b deleted the fix/dev3-native-bug-hunter-panes branch August 2, 2026 16:22
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.

1 participant