Skip to content

Open real auxiliary panes on the native terminal backend - #1222

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

Open real auxiliary panes on the native terminal backend#1222
h0x91b merged 2 commits into
mainfrom
fix/dev3-native-auxiliary-panes

Conversation

@h0x91b

@h0x91b h0x91b commented Aug 2, 2026

Copy link
Copy Markdown
Owner

On a task using the native terminal backend, starting the dev server or running
Rebase never produced a visible pane. Both actions split into dev3-<id>, a tmux
session a native task does not have. The two halves failed differently, which is
why one bug looked invisible and the other looked broken:

  • Dev Server started the dev script in a tmux session dev3-dev-<id>, then
    failed the viewer split inside a best-effort catch. The server ran with ports
    bound and no pane anywhere — including a tmux session a native task should never
    touch at all.
  • Rebase — and Merge / Push / Open PR, which share one helper — threw
    tmux split-window failed instead of doing anything.

The seam

src/bun/task-aux-panes.ts owns every pane an action opens. It picks tmux split vs
native SplitTree pane, replaces the pane a purpose already owns instead of stacking
a second one, and hands focus back to the pane that had it — the native coordinator
makes a new pane active on split, so the agent would otherwise lose input.

Ownership is derived, never stored: a pane is re-found by matching the command it
was launched with, exactly as the tmux code already did with #{pane_start_command}.
Nothing is cached in RAM (which a restart would lose while the pane lives on) and
nothing new is written under ~/.dev3.0/. Pane labels fall out of the same lookup,
so the narrow pager and the close-pane picker can say "Dev Server" instead of "Pane 2".

Callers supply what each backend runs, because they differ: the tmux dev-server pane
runs a re-attach loop into a nested session, while the native pane runs the dev script
itself. tmux behaviour is unchanged and pinned by tests asserting the split arguments.

Two leaks the same blind spot caused

  • lifecycle/executor.ts killDevServer explicitly skipped native tasks, with a
    comment claiming a native task owns no dev server. It does — the whole dev-server
    process tree and its pool ports leaked on teardown.
  • exitCopyModeAllPanes probed tmux on native tasks.

Behaviour

An action that genuinely cannot run fails honestly: starting the dev server with no
live terminal reports "the task terminal is not running, so it has no pane to split"
and creates no tmux session and no hidden process. That is precisely the case that
used to start an invisible one.

h0x91b added 2 commits August 2, 2026 13:24
Dev-server and git-operation panes were raw tmux splits against dev3-task-<id>,
a session a native task never has. The git panes threw; the dev-server split
failed inside a best-effort catch, so the dev script kept running invisibly in a
tmux session a native task should never touch at all.

Add a backend-neutral seam that owns auxiliary panes: it derives ownership from
the command a pane was launched with (as the tmux code already did), replaces the
pane a purpose already owns instead of stacking a second one, and hands focus
back to the pane that had it. Route the dev server and the shared git-operation
pane through it, and make the dev server's liveness, status and teardown read the
right host per backend.

Also fixes two leaks the same blind spot caused: task teardown skipped the dev
server entirely on native, and the agent hand-off prompts (rebase conflicts,
Create PR, Commit, scheduled messages) were tmux-only, so they silently did
nothing.
Backend matrix over the seam, the dev server and the agent hand-off: the native
paths must make zero tmux calls, must not stack a second pane on a repeated
action, and must leave the agent pane focused. The tmux cases assert the split
arguments unchanged, so the old behaviour stays pinned.

Renderer: an auxiliary pane is named in the narrow pane pager and in the
close-pane picker instead of falling back to "Pane N".
@h0x91b
h0x91b merged commit fcbd417 into main Aug 2, 2026
9 checks passed
@h0x91b
h0x91b deleted the fix/dev3-native-auxiliary-panes branch August 2, 2026 10:30
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