Skip to content

Fix executor nudge misdelivered to shell pane when detail view is open#553

Merged
bborn merged 1 commit into
mainfrom
fix/tmux-nudge-pane-misdelivery
Jun 4, 2026
Merged

Fix executor nudge misdelivered to shell pane when detail view is open#553
bborn merged 1 commit into
mainfrom
fix/tmux-nudge-pane-misdelivery

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented Jun 4, 2026

Problem

Tasks would silently stall — "the executor randomly stopped working." When a task's detail view is open, the UI's joinTmuxPane moves the agent pane out of the daemon window into the task-ui session. The four "continue working" resume nudges targeted windowTarget+".0", which after that join resolves to the shell pane (or a now-destroyed window). The agent never receives the nudge, so it sits idle forever.

This is independent of the Claude Code version — a latent pane-targeting bug (same class as the codebase note about preferring claudePaneID over cachedWindowTarget).

Fix

Resolve the send-keys target from the persisted claude_pane_id (the same stable %pane_id the UI already uses for capture, written by savePaneIDs), falling back to windowTarget+".0".

  • agentSendTargetForPane(claudePaneID, windowTarget) — pure, unit-tested
  • Executor.agentSendTarget(taskID, windowTarget) — reads the persisted id
  • Wired into resumeClaudeDangerous, resumeClaudeSafe, resumeCodexWithMode, resumeGeminiWithMode

Test plan

  • go test ./internal/executor/ — green (new TestAgentSendTargetForPane + full suite)
  • Verified end-to-end through the real TUI (isolated instance): opening the detail view fires the real joinTmuxPane; afterward the legacy target task-daemon-*:task-N.0 no longer resolves, while sending to the persisted pane id reaches the agent.

A repeatable harness for this kind of real-TUI QA is in a companion PR (scripts/qa/).

🤖 Generated with Claude Code

When the detail view is open, the UI's joinTmuxPane moves the agent pane out
of the daemon window into the task-ui session. The four "continue working"
resume nudges targeted windowTarget+".0", which after the join resolves to the
shell pane (or a now-destroyed window) — so the agent never receives the nudge
and the task silently stalls ("executor randomly stopped working").

Resolve the send-keys target from the persisted claude_pane_id (the same stable
%pane_id the UI already uses for capture), falling back to windowTarget+".0".

- Add agentSendTargetForPane (pure, unit-tested) + Executor.agentSendTarget
- Wire into resumeClaude{Dangerous,Safe} and resume{Codex,Gemini}WithMode

Verified end-to-end by driving the real TUI: opening the detail view fires
joinTmuxPane, after which the legacy window-relative target no longer resolves
while the persisted pane id reaches the agent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bborn bborn force-pushed the fix/tmux-nudge-pane-misdelivery branch from 45df68c to 0f1bbc8 Compare June 4, 2026 21:03
@bborn bborn merged commit 3da557f into main Jun 4, 2026
3 of 4 checks passed
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