Skip to content

Typing after an Agent edge drag goes partly to the other area's pane #413

Closed

Description

@yansfil

What happened

After an Agent tab is dragged into a new area and the operator clicks back into the first area, part of the line typed there goes to the other area's pane.
desktop/e2e/agent-tab-groups.spec.ts "Agent edge drag splits the desktop column into two live tab groups" fails at line 40 this way.
In main 987778a (run 37182041622, job 111376392409) the typed printf 'desktop-group-live\n' ran as printf 'desktop-grouve\n'.

Reproduced locally with a debug hided and the pinned Herdr, 1 of 8 runs with 4 busy CPU processes on 14 cores: the first pane ran printf 'desktogroup-live\n' and the missing p- sat on the dropped tab's pane prompt.
So the bytes were sent to the wrong pane, not lost.

Event order in that run (renderer, core diagnostics and Herdr server log on one clock):

  1. The drop sends tab.focus w1:t2; Herdr applies it.
  2. The click into the first area sends tab.focus w1:t1 about 70 ms later, before Hide has read Herdr's answer to the drop.
  3. The next session reconcile still shows t1 active from before the drop, and reconcile_visible_tabs reads that as confirmation of the t1 request, so nothing is pending.
    This step is inferred from the code and the deterministic reproduction below; the live run's log does not record the confirmation itself.
  4. Herdr's answer to the drop (t2) then arrives; with nothing pending it is treated as an operator focusing t2 outside Hide (tab.focus.followed t1 to t2), the keyboard pane moves to t2's pane, and PaneView moves DOM focus there mid-line.
  5. Herdr's answer to the click follows (tab.focus.followed t2 to t1) and the keyboard comes back.

The renderer record shows data-focused flipping between the two panes five times within 54 ms while the keys were being sent, and the WebSocket key frames for p and - naming the other pane.

#303 tracks a different signature in the web suite (output stopping in the area that lost the keyboard, with herdr pane run, no typed input); its 2026-10-01 comment already suspected this focus bounce for the desktop test.

What you expected

Every byte typed after the click reaches the clicked pane exactly once.
Herdr's late answer to a tab focus Hide itself replaced does not move the keyboard.

Steps to reproduce

  1. Build a debug hided and the desktop app, and use the pinned Herdr.
  2. Run desktop/e2e/agent-tab-groups.spec.ts repeatedly while the machine is moderately busy; it fails in a minority of runs.

Deterministic core reproduction: focus tab t2, focus tab t1, then ingest sessions naming t1, t2, t1 in that order; on main the visible tab and keyboard pane move to t2 at the second session.

Versions

  • hide: main 987778a (CI failure), 494ee5b (local reproduction)
  • Herdr: v0.9.1 (the pin)
  • macOS: GitHub macOS runner; local macOS 15.1

Diagnostics

Not confirmed: whether the same bounce explains any web-suite failure; #303 remains about the output stall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions