Skip to content

Fix the web e2e flakes on loaded runners at their causes - #249

Merged
yansfil merged 9 commits into
mainfrom
fix/e2e-flakes
Sep 28, 2026
Merged

yansfil merged 9 commits into
mainfrom
fix/e2e-flakes

Conversation

@yansfil

@yansfil yansfil commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Related: #231; built on #238, now merged into main (ff9235b).

Summary

Part of #231: five of the six specs have a cause and a fix or are shown fixed on main with #238; tab-names:9 did not reproduce (see Evidence).
The web e2e flakes on loaded macos-15 runners came from two product races and three specs that asserted before the state they check existed.
Product fixes: a delegated child is moved to its own tab once, not twice; an attached terminal sends its grid once, not twice.
The core also logs why it refuses a Reopen (recent_closed.* diagnostics).
Spec fixes wait on the state the step asserts; no timeout or retry was added.
No screen changes, so no screenshots.

Spec (CI failure) Cause Fix
agent-tab-groups:203 pane view missing after the delegated chip The core read the previous update's layouts and dropped the move's in-flight stamp on Herdr's acknowledgement, so it moved the child twice (CI daemon log: lineage.relocated twice, t2 then t3) Core: relocation runs after the update's layouts are stored and keeps the stamp until the layout shows the move; spec waits for the child to leave the parent's canvas
agent-tab-groups:33 4 terminal_resize where 2 expected A ResizeObserver reports once on observe, re-sending the grid the attach just sent (CI trace: same 101x61, 76 ms later), not a reconnect Web: the observer sends only a changed grid, as ARCHITECTURE already promises
agent-tab-groups:157 Reopen adds no tab (not one of #231's six) Not isolated: in every failure the core receives no reopen at all, and the page keeps drawing the closed tab in the other area None; see Review and Evidence
palette:28 no-match line missing Typing started before the reopened palette held focus (CI snapshot: query t) Spec waits for the input's focus, as its first ⌘K already does
s2:39 new tab reads zsh, not Tab 2 display_tab_label shows the pane's process for an automatic label once Herdr reports it Spec reads the label from Herdr and checks the selected tab's id
agent-close-contract:13 Overview card detaching On main the Tasks board first draws an ad-hoc card for linked, then settles to its empty state (no task source, no agent); the click hit the transient card (run 36428309660's snapshot: Tasks tab, empty board, no card) Fixed by #238's enterWorkspace (now on main), which goes through lens lanes that a project with no agent never draws
tab-names:9 (desktop) Copy name menu missing Not reproduced: 25 of 25 passed locally; the failing run predates #246 and left no page snapshot None; remains open under #231

Review

  • Judge: agent-tab-groups:157 still fails, on CI (run 36456434873) and locally, and this diff plausibly raises its rate: under 8 workers this head failed it 3 of 70 repeats, origin/main 0 of 50.
    It is not new: it failed on feat/new-tab-where-keyboard CI (da94aa0) and 2 of 5 on the pre-Overview lenses: tile header, checkout lanes, issue-only Issues with a panel, and a PRs tab #238 base here.
    Every failure looks the same: the closed tab w1:t3 is still drawn in the right area, and the core logs no reopen, not even a refusal, so the chord never reached it.
    An earlier commit on this branch forwarded every ⌥⇧T to the core; CI failed the same way with it, so it was reverted (a3db999).
    The test uses no agents, so the relocation change is inert there.
    The grid dedupe in web/src/terminals.ts is the likely contributor: this head with only terminals.ts swapped back to main's failed :157 0 of 60.
    Counts this small (3 of 70 against 0 of 110) do not prove it, and the mechanism is not found; reverting the dedupe would reopen agent-tab-groups:33, so that trade is left to review.
  • Files to watch: herdr-core/src/runtime/session.rs - relocation moved after store_pane_layouts inside the session ingest, under the runtime mutex.
  • Files to watch: web/src/terminals.ts - high-frequency path; attach, full-frame request and text scale still always send, only the observer dedupes.
  • Question: docs/UI_BEHAVIOR.md:760 says Reopen Closed Tab "is disabled" and 761-763 promise inline notices, but no surface disables it or draws them (true before this PR too). Should that be its own issue?

Evidence

  • Confirmed: 20 repeats of each touched spec (agent-close-contract, agent-tab-groups x4, s2 x2, palette) with 8 parallel workers on this 10-core Mac: 160 of 160 passed.
  • Confirmed: after the last base merge, agent-close-contract and agent-tab-groups x20 each under 8 workers: 100 of 100; desktop tab-names x20: 20 of 20 (not @needs-focus, so the locked session did not block it).
  • Confirmed: the same five spec files x5 under 8 workers: base build 48 passed, 2 failed (agent-tab-groups:157); this branch 50 of 50 before and 50 of 50 after merging the moved base (those runs included the since-reverted reopen change; the larger samples above supersede them for :157).
  • Confirmed: full web e2e, one worker as in CI, after merging the moved base: 88 of 88 passed (the later base merge touched only desktop config and docs).
  • Confirmed: new core test an_acknowledged_relocation_stays_in_flight_until_the_layout_shows_the_move failed on the old ordering and passes now; verify-cargo.sh lint and verify-web.sh pass.
  • Not confirmed: weekly-usage.spec.ts:79 failed every time on this machine before the base merge and on Overview lenses: tile header, checkout lanes, issue-only Issues with a panel, and a PRs tab #238's CI at 5acb6a7; it passed after the merge, and this PR does not touch it.
  • Not confirmed: herdr-core github::tests (1 s gh fixture timeouts) fail intermittently on this machine alone and under load; github.rs is untouched, and CI's rust lane passes them.
  • Confirmed: after merging main at ff9235b, the touched specs plus s6 x5 under 8 workers: 45 of 45.
  • Confirmed: CI-failing specs, 20 to 30 repeats per batch under 8 workers, agent-tab-groups:157 + :203 + s2:39 together:
    this head (a3db999): :157 failed 3 of 70 untraced repeats (plus 0 of 60 with a wire trace attached), :203 0 of 110, s2:39 0 of 110;
    origin/main (eb30664): :157 0 of 50, :203 0 of 50, s2:39 failed 2 of 50.
  • Confirmed: main's own CI at eb30664 (run 36451459470) failed agent-tab-groups:203 and s2:39, two of the specs this PR fixes.
  • Not confirmed: run 36456434873 (head a9589a0) failed only agent-tab-groups:157 (above).
  • Confirmed: run 36462630853 on head a3db999 is green in every job.
  • Not confirmed: a second consecutive green run. Run 36442619262 failed only s6.spec.ts:342: the child moved once, but the core had followed a stale Herdr focus answer for it (below), so its new tab came forward.
  • Not confirmed: run 36447121027 (head 15adcdc, base main) failed only overview.spec.ts:597: the issue hover preview stayed open after the pointer left. That spec came with Overview lenses: tile header, checkout lanes, issue-only Issues with a panel, and a PRs tab #238, passed on main's CI at ff9235b and 8 of 8 here under 8 workers; this diff touches no hover or Overview code.
  • Not confirmed: its rerun failed only agent-tab-names.spec.ts:7 (rename input lost focus). The daemon log shows the core following a Herdr focus event 2 s after Hide had moved on, so the page focused that terminal; that path is not in this diff.
  • Confirmed: agent-tab-names:7, s6:28 and overview:164, 20 repeats each under 8 workers: this head (a9589a0) 60 of 60, origin/main at eb30664 60 of 60. In the last 100 PR runs, agent-tab-names:7 and s6:28 failed only on this PR, once each.
  • Not reproduced: s2:300 (closed pane still drawn after 5 s) from Overview lenses: tile header, checkout lanes, issue-only Issues with a panel, and a PRs tab #238's CI run; the core confirmed the close in 380 ms and deltas reached the page 1.7 s later; it passed every local run.
Follow-ups outside #231
  • A followed Herdr focus moves DOM focus to a terminal even while an inline editor (tab rename) holds it (agent-tab-names:7 on run 36447121027 attempt 2).
  • Pane focus ABA (s6:342 on run 36442619262): the spec focused p1, p2, p1; Herdr's answer to the first p1 cleared the newer pending p1, and its p2 answer was then followed as an outside move (pane.focus.followed with no pending request). A pending focus needs a request identity, not only a target.
  • Keys typed between ⌘K and the palette input taking focus are dropped (the palette spec now waits for focus; the product still drops input).
  • s2:39 no longer asserts the tab strip's text for a new tab, only Herdr's label and the selected tab id; a check that the strip shows either the label or the process name would restore that coverage.
  • projects-sidebar:97 line 410 and desktop add-project:134 / browser:178 (from other PRs' CI) did not reproduce here.
  • A relocation stamp lingers until its pane closes if the child stops being delegated before the confirming layout; harmless, since the retry interval has passed.
  • s6.spec.ts:164 polls for 300 ms of resize quiet; with the observer dedupe that wait may no longer be needed.
  • A reopen pressed while a restore is still in flight is dropped (reopen_in_flight); an operator gets no feedback.
  • agent-tab-groups:157: find why ⌥⇧T after closing a tab in the left area never reaches the core while the page keeps the closed tab drawn in the right area.
  • hided closes a WebSocket on a send or receive error without logging why.

AI tooling: mostly AI tools; causes checked by hand against CI daemon logs, wire traces and page snapshots.

The relocation pass read the previous update's layouts, and Herdr's
acknowledgement of pane.move cleared the in-flight stamp before the
layout that shows the move arrived. On a loaded runner the update in
between asked Herdr again and moved the child from its new tab into a
third one. The pass now runs after the update's layouts are stored and
keeps the stamp until the layout shows the child outside its parent's
tab.
A ResizeObserver reports once when it starts watching, so every attach
sent its grid twice. The observer now sends only a grid the host's new
size changed; the attach, a full-frame request and a text scale change
still always send.
The page dropped the reopen chord when its copy of recent_closed said
nothing could be reopened, a copy that can trail the core. The chord now
always reaches the core, which applies the same rule, and each refusal
is written to the diagnostic log.
…ssert

The palette is typed into only once it holds focus; a new tab is checked
by the label Herdr stores, because the strip names an automatic label
after the pane's process once Herdr reports it; the delegated chip is
clicked once the child has left its parent's canvas.
Base automatically changed from feat/overview-lenses to main September 28, 2026 15:36
Forwarding every Reopen chord to the core did not fix agent-tab-groups
New tab and Reopen: on CI the core received no reopen at all, so the
page gate was not what dropped it.
@yansfil
yansfil merged commit a694e82 into main Sep 28, 2026
13 checks passed
@yansfil
yansfil deleted the fix/e2e-flakes branch September 28, 2026 22:40
yansfil added a commit that referenced this pull request Sep 28, 2026
main's #249 fixed the same delegated-pane relocation repeat this branch
fixed: both keep the move in flight until the layout shows it. Its version
also runs the pass after the update's layouts are stored, so the conflicts
in agents.rs, terminal.rs and the relocation test take main's side.
yansfil added a commit that referenced this pull request Sep 29, 2026
Related: PRD `agents/prd/checkout-workspace-binding/prd.md`

## Summary

Hide가 만든 새 탭이 체크아웃과 상관없는 Herdr 워크스페이스(예: main 탭이 `home-graph` w8P)에 생기고,
에이전트 이름이 그 워크스페이스 라벨로 보였습니다.
이제 체크아웃마다 소유 워크스페이스 하나를 Herdr에서 읽습니다: git은 Herdr가 그 경로에 묶은 워크스페이스, 일반
폴더는 Hide 표시 토큰(`hide_owner`)을 가진 워크스페이스입니다.
새 탭, New agent, 에이전트 시작, Reopen Closed Tab, 등록 프로젝트 열기가 모두 소유로 가고, 소유가
없으면 `worktree.open`(폴더는 `workspace.create`+표시)으로 하나를 엽니다.
SSH 기기 체크아웃은 폴더로 식별해 mini의 w5N/w5T처럼 한 폴더의 워크스페이스 여럿이 한 줄이 되고, task 없는
에이전트는 제공자 이름(`Claude`, `Codex`)으로 부릅니다.

화면 배치는 바뀌지 않습니다. 격리된 Herdr에서 묶이지 않은 워크스페이스의 탭에서 새 탭 두 번을 누른 결과(두 탭 모두 소유
워크스페이스에 생김):

![묶이지 않은 워크스페이스의 탭에서 새 탭 두 번: 두 탭 모두 소유 워크스페이스(w1)에
생김](https://github.com/yansfil/pr-assets/blob/main/hide/checkout-workspace-binding/5fb5b51/checkout-owner-git.png?raw=true)

## Review

- **판단해 주세요**: 묶인 워크스페이스가 없고 묶이지 않은 워크스페이스가 이미 그 체크아웃에 있으면, Herdr 0.9.1
`worktree.open`이 새로 만들지 않고 그것을 묶습니다(`already_open`). Hide는 그대로 따르고 이름은
바꾸지 않습니다. B2의 "하나를 연다"를 이렇게 읽어도 되는지.
- **판단해 주세요**: 도우미가 아직 확인하지 않은 기기 폴더는 git인지 모르므로 소유가 없을 때 새 탭을
`remote.control.checkout_unconfirmed`(재시도 가능)로 거절합니다. 추측해서 잘못된 종류의
워크스페이스를 만들지 않으려는 선택입니다.
- **판단해 주세요**: Herdr가 새로 연 워크스페이스만 사이드바 이름으로 바꿉니다(`workspace.rename`).
`worktree.open`에 label을 주면 이미 열린 운영자 워크스페이스 이름까지 바뀌어서 label을 보내지 않습니다.
- **판단해 주세요**: 소유 워크스페이스가 생기면서 체크아웃의 마지막 탭을 닫으면 워크스페이스가 함께 닫히는 일이 흔해졌고,
이것이 기존 결함 두 개를 드러냈습니다. 둘 다 이 PR에서 고쳤습니다.
1. Herdr 0.9.1은 원인보다 늦거나 이른 이벤트를 보냅니다(마지막 탭을 닫으면 `workspace_closed` 다음에
`tab_closed`, 새 워크스페이스의 생성 이벤트는 그 뒤의 변경이 끝난 다음에 도착). 복제본은 이를 어긋남으로 보고
스냅샷을 새로 읽었고, 그동안 마지막 닫기가 확인되지 않아 Reopen Closed Tab이
버려졌습니다(`agent-tab-groups.spec.ts:157` 간헐 실패의 원인). 이제 이벤트가 지운 id를 기억해 그
id에 대한 늦은 이벤트는 이미 반영된 것으로 처리하고(`event.already_applied` 로그), 아직 알리지 않은
탭·창에 대한 포커스는 그것이 올 때 적용합니다. main도 같은 거절이 `sidebar-menus`,
`worktree-delete`, `worktree-removing-menu`에서 납니다.
2. 위임된 창 이동 요청이 Herdr의 응답만 받고 끝난 것으로 처리되어, 이벤트가 오기 전에 같은 창을 다시 옮겼습니다. 옮길
때마다 앞 이동이 만든 탭이 닫혀 레이아웃이 반영되지 않았고, main에서는 위 재동기화가 우연히 반복(실행당 2-11회)을
끊었습니다. main의 #249가 같은 문제를 같은 방식(레이아웃이 이동을 보여줄 때까지 진행 중)으로 고쳐서, 두 번째 main
병합(7e6aa9e)에서 충돌은 main 쪽을 택했습니다.
- **조심해서 볼 파일**: `herdr-core/src/session_sync/replica.rs`
`retired_ids`/`early_focuses` - 복제본이 어긋남으로 거절하던 이벤트 중 무엇을 이제 받아들이는지. id는
64개, 보류 포커스는 16개로 제한됩니다.
- **조심해서 볼 파일**: `herdr-core/src/live.rs`
`ensure_owner`/`open_owner_tab` - Herdr 호출과 실패 경로, 일반 폴더용 프로세스 전역 잠금.
- **조심해서 볼 파일**: `herdr-core/src/device_catalog.rs` `group` - 기기 체크아웃
id가 워크스페이스에서 폴더 해시로 바뀜, 옛 id 접힘 상태 이관(`legacy_checkout_ids`).
- **조심해서 볼 파일**: `herdr-core/src/runtime/session.rs` - 소유 계산이 runtime
mutex 안에서 이미 받은 세션만 읽는지(스냅샷당 Herdr 호출·I/O 없음).
- **조심해서 볼 파일**: `herdr-core/src/runtime/projects.rs`
`agent_start_in_checkout` - main 병합 충돌을 소유 경로를 유지하고 main의 시작
프롬프트(`payload.prompt`)를 실어 풀었습니다.
- **조심해서 볼 파일**: `herdr-core/src/live.rs` `registered_owner` - 병합 후
main에서 온 탭·워크스페이스 생성 경로를 모두 확인하다 찾은 기존 누락: 프로젝트 등록이 일반
`workspace.create`로 새 워크스페이스를 만들었습니다. 이제 등록도 체크아웃의 소유를 엽니다(git 하위 폴더는
체크아웃 루트, 그 밖은 폴더 표시).

## Evidence

- **확인한 것**: 두 번째 main 병합 head(7e6aa9e)에서 `sasu implement verify`
PASS(`verify-cargo.sh test`, `lint`), `verify-web.sh` 통과. 전체 web e2e는 84
통과, `checkout-owner` 4/4, hided 로그의 `event.rejected` 0건. 나머지 9개는 픽스처의
`git commit`이 이 Mac의 커밋 서명 에이전트(Secretive, 잠김)에 거절된 것이라, 서명을 끈 git 설정
사본(`GIT_CONFIG_GLOBAL`)으로 다시 돌려 9/9 통과했습니다. verify도 같은 설정으로 돌렸습니다(서명을 쓰는
cargo 테스트 5개가 같은 이유로 실패).
- **확인한 것**: 격리된 pinned Herdr 0.9.1에서 `web/e2e/checkout-owner.spec.ts`
4/4: 비소유 탭에서 요청해도 소유로, 소유 없음+묶이지 않은 것 채택(이름 유지), 링크 워크트리 새로 열고 브랜치 이름,
일반 폴더 두 번 빠른 요청에 워크스페이스 하나.
- **확인한 것**: 전체 web e2e: 고치기 전에는 `agent-tab-groups.spec.ts:157`이 3번 중 2번
실패(b46f728 1번, 65ccfc7 2번 중 1번), main(eb30664)은 89/89. 병합 전
head(3b43c18, 로그 이름의 44fa25b8과 같은 tree)는 두 번 모두 93/93이고, 두 실행의 hided 로그
어디에도 `event.rejected`가 없습니다(main은 로그 4개에 있음).
- **확인한 것**: `agent-tab-groups:157`만 부하 중 반복: 고치기 전 6번 중 3번 실패(모든 실행에
`event.rejected`), 고친 뒤 12/12와 8/8 통과, `event.rejected` 0건.
`sidebar-status.spec.ts:36`: 복제본만 고친 상태에서 14번 중 10번 실패(창 이동 93-188회,
main은 2-11회), 이동 대기까지 고친 뒤 6/6 통과(이동 1회).
- **확인한 것**: 격리 Herdr 탐침으로 이벤트 순서를 확인해 unit 테스트로 옮겼습니다: 마지막 탭·창 닫기,
`layout.apply`로 새 워크스페이스의 첫 탭 바꾸기, 새 워크스페이스에 바로 포커스 탭 만들기, 창을 새 탭으로 반복
이동.
- **확인한 것**: 격리 Herdr 탐침으로 `worktree.open` 동작 확인: 링크 워크트리는 main worktree
cwd가 필요(`linked_worktree_source`), label은 열린 워크스페이스도 바꿈.
- **확인한 것**: 이 Mac과 mini Herdr를 읽기만 해서 PRD 사실 확인(w9J·w5N·w3Y 묶임,
w8P·w5T·w43 안 묶임). 아무것도 만들거나 옮기지 않았습니다.
- **확인하지 못한 것**: 실제 mini에 대한 기기 새 탭·포커스·purpose는 격리 e2e가 없어 unit
테스트(mini 모양 세션)로만 확인했습니다. 설치된 `/Applications/hide.app`에서는 확인하지 않았습니다.
- **확인하지 못한 것**: 일반 폴더 표시 토큰이 Herdr 재시작·live handoff 뒤 사라지는지(D-11 위험)는
실행해 보지 않았습니다. 사라지면 다음 탭이 새 워크스페이스를 하나 더 만듭니다.
- **확인하지 못한 것**: 빠르게 두 번 누른 새 탭이 같은 이름(`Tab 2`)을 받는 것은 두 요청이 같은 다음 라벨을
계산하기 때문이며 이 변경 전부터 있던 동작입니다(후속).
- **확인하지 못한 것**:
`github::tests::timed_out_gh_and_its_pipe_holding_helper_are_terminated`(main에서
온 테스트, 이 PR은 `github.rs`를 바꾸지 않음)가 전체 herdr-core 테스트에서 가끔 실패합니다. 연달아 돌린
비교에서 main 0/7, 이 브랜치 12번 중 3번 실패(한 번은 같은 파일의
`an_issue_panel_reads_only_its_fields...`도). 가짜 `gh`가 1초 안에 pid를 쓰지 못해
생기며, 혼자 돌리면 두 쪽 모두 4/4 통과합니다. 새 owner 테스트의 `git init`을 빼도 5번 중 1번 실패해서
원인을 찾지 못했습니다(후속). `sasu implement verify`는 최종 head에서 통과했습니다.
- **확인하지 못한 것**: desktop e2e(`pnpm --dir desktop e2e`)는 돌리지 않았습니다.

<details><summary>추가 증거</summary>

![묶인 워크스페이스 없음: Herdr가 체크아웃의 기존 워크스페이스를 묶고 이름은
그대로](https://github.com/yansfil/pr-assets/blob/main/hide/checkout-workspace-binding/5fb5b51/checkout-owner-adopt.png?raw=true)

![링크 워크트리에 워크스페이스 없음: 하나를 열어 브랜치 이름
feature로](https://github.com/yansfil/pr-assets/blob/main/hide/checkout-workspace-binding/5fb5b51/checkout-owner-linked.png?raw=true)

![일반 폴더: 빠른 새 탭 두 번에 표시된 워크스페이스
하나](https://github.com/yansfil/pr-assets/blob/main/hide/checkout-workspace-binding/5fb5b51/checkout-owner-folder.png?raw=true)

</details>

**AI tooling**: 대부분 AI 도구. PRD의 B1-B16을 코드와 격리 Herdr e2e 결과에 하나씩 대조했습니다.

<details><summary>Verification record</summary>

- PRD: `agents/prd/checkout-workspace-binding/prd.md` (sha256
c5d637b351bbbfdbe458e1aa499c8663b5f6f311a875455b800866a9c0b291d0)
- Base 55e0593 → head 7e6aa9e, verified 2026-09-28T23:51:07.318Z: PASS
- Verification report:
`agents/runs/checkout-workspace-binding/verification-report.json` and
`agents/runs/checkout-workspace-binding/verification-report.md`; source
fingerprint
d23453553dc787ca7614f8dfdf0c505a49065e1d66c2616e286564f5b4fea12f
- Suites:
  - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0)
  - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0)
- Reviews:
- Fidelity (b46f728, follow-ups at 5fb5b51): Fix now 1 e2e failures ->
813a754 renames a new owner's first tab; s2 and agent-tab-groups pass
(12/12 x3). Fix now 2 B11 device folds under old ids -> 0d23a72
`legacy_checkout_ids`; device selection is never persisted. Evidence
check: the checkout-owner log is tagged 0d23a72 but ran with the
adoption spec that 5fb5b51 commits (registered files are append-only,
so not renamed). Follow-ups: Reopen owner-lookup unit test, mark-failure
counting, `SidebarAgentSnapshot.workspace_label` wire cleanup.
- Code (b46f728, follow-up at 5fb5b51): hided disconnect disproved by
logs (no panic). Path canonicalization rejected: I/O under the runtime
mutex (B16), and a miss only costs one `worktree.open` answering
`already_open`. Global plain-folder lock kept with its reason commented.
Reopen position rule documented. Purpose never opens an owner (B16).
Follow-up: prune legacy ids that never resolve. Open question (split
part owner only at index 0) holds by construction: part 0 is the
workspace's own folder, the only path Herdr binds or Hide marks.
- Observer plan review: device rows bring the last host-focused tab per
checkout forward (b46f728).
- Merge follow-up review (aa502a8 merge of main + 65ccfc7): no Fix
now. Conflict in `agent_start_in_checkout` keeps the owner host and
carries main's `payload.prompt`; every Hide tab creation on the merged
head goes through `tab_host`/`ensure_owner`. Follow-up: registration's
`needs_herdr_workspace` compares ids `adopt_registration` always
equalizes; harmless because `ensure_owner` reuses a bound or marked
owner.
- Observer notice (agent-tab-groups:157 failed 2 of 3 full runs): root
cause was replica rejection of Herdr 0.9.1's late/early events (trailing
`tab_closed`/`pane_closed` after `workspace_closed`, a new workspace's
creation events arriving after later changes), which resynced and
dropped Reopen; main shows the same rejection in three other specs.
Fixed in 819054a; the fix exposed a relocation livelock that main's
resync had been masking, fixed in 3b43c18.
- Code review of 819054a: Fix now held pane focuses never purged, and
no diagnostic on the already-applied path -> 626de09 (an applied focus
supersedes held ones, retiring an id drops focuses held for it,
`event.already_applied`). Follow-up fixed in 626de09: `pane_moved`'s
created tab cancels a pending closure. Follow-up left: `names_retired`
does not cover `workspace_closed`, `tab_moved`, `pane_moved` or worktree
events (they still resync as before).
- Code review of 626de09 + 3b43c18: no Fix now standing. A relocation
stamp left when the child stops qualifying cannot block a later move:
only a stamp younger than `RELOCATION_RETRY_INTERVAL_MS` holds, and the
map is pruned to panes Herdr reports. Follow-ups: a unit test for
`pane_moved` cancelling a pending closure, and for the
`event.already_applied` diagnostic.
- Second main merge review (7e6aa9e): no Fix now. Conflicts in
agents.rs, terminal.rs and the relocation test take main's #249 version
of the same fix; the surviving doc line and ARCHITECTURE sentence match
it. #249's reopen gate runs upstream of the owner path, and its fixture
changes are compatible with checkout-owner.spec.ts. Follow-up: the
page's `recent_closed.can_reopen` gate can trail the core, and an owner
open before a reopen may widen that window (not reproduced).
- Evidence: 25 registered (11 log, 4 screenshot, 10 file); paths are
local to the run directory
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-checkout-owner-at-0d23a72e.log
-
agents/runs/checkout-workspace-binding/evidence/e2e-final/checkout-owner-git.png
-
agents/runs/checkout-workspace-binding/evidence/e2e-final/checkout-owner-adopt.png
-
agents/runs/checkout-workspace-binding/evidence/e2e-final/checkout-owner-linked.png
-
agents/runs/checkout-workspace-binding/evidence/e2e-final/checkout-owner-folder.png
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-full-at-b46f7288.log
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-rerun-s2-atg-at-813a754f.log
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-agent-tab-groups-x3-at-813a754f.log
-
agents/runs/checkout-workspace-binding/evidence/live-read/mac-workspaces.jsonl
-
agents/runs/checkout-workspace-binding/evidence/live-read/mini-workspaces.jsonl
- agents/runs/checkout-workspace-binding/evidence/logs-e2e/wt-probe3.sh
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-full-at-65ccfc7a.log
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-full-traced-at-65ccfc7a.log
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-full-main-eb306645.log
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-full-at-44fa25b8-run1.log
-
agents/runs/checkout-workspace-binding/evidence/event-order/close-order-probe2.out
-
agents/runs/checkout-workspace-binding/evidence/event-order/create-order-probe.out
-
agents/runs/checkout-workspace-binding/evidence/event-order/reopen-order-probe.out
-
agents/runs/checkout-workspace-binding/evidence/event-order/move-order-probe.out
-
agents/runs/checkout-workspace-binding/evidence/event-order/main-eb306645-rejections-per-log.txt
-
agents/runs/checkout-workspace-binding/evidence/event-order/probe-rejections-per-run.txt
-
agents/runs/checkout-workspace-binding/evidence/event-order/sidebar-status-relocations-per-run.txt
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-full-at-44fa25b8-run2.log
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-full-at-7e6aa9e4.log
-
agents/runs/checkout-workspace-binding/evidence/logs-e2e/web-e2e-rerun-nosign-at-7e6aa9e4.log
- Changed paths: 147 (see Files changed)

</details>
yansfil added a commit that referenced this pull request Oct 29, 2026
…back runs (#1835)

Closes with-hide/hide-private#127

## Summary

- Settings에서 언어를 고른 직후 글자 크기 slider에 End를 누르는 desktop 테스트 3개가 가끔
실패했습니다(#127: 17 대신 13).
- 원인: 닫히는 언어 Select가 키보드를 자기 버튼에 돌려주는 일을 타이머로 미룹니다. 부하가 걸리면 그 타이머가 테스트의
`slider.focus()` 뒤에 돌아 End가 버튼으로 갑니다.
- 제품 수정: Select가 닫힌 뒤 다른 컨트롤이 이미 키보드를 가져갔다면, 늦게 도는 반환이 그 focus를 빼앗지
않습니다. 아무것도 가져가지 않았으면 예전처럼 Select 버튼으로 돌아갑니다. 메뉴와 대화상자가 쓰는 같은
보호(`useReturnFocus`)를 Select도 거칩니다(`docs/UI_BEHAVIOR.md`: a delayed
focus return from any layer leaves a newer control or layer's focus in
place).
- 테스트: 세 테스트는 그 반환이 끝난 상태(언어 버튼에 focus)를 기다린 뒤 키보드를 옮깁니다. 대기 시간, retry,
lane은 그대로입니다.

스크린샷 없음: 키보드 focus가 어디로 가는지만 바뀌고 그려지는 화면은 같습니다.

이 묶음(mission-13 flaky2-mac-viewarea)의 10개 이슈 처리, 10-23~10-29 macOS
desktop CI 기록 304회 기준:

| 이슈 | 테스트 | 처리 |
| --- | --- | --- |
| #127 | pane-move 글자 크기 | 이 PR (304회 중 3회 재발) |
| #157 | new-tab ⌘T/⌘W | #1650이 고침, 닫음 (마지막 실패 커밋은 #1650 이전) |
| #177 | group-tabs 새 터미널 | #1493이 고침, 닫음 |
| #178 | new-terminal | macOS 서명은 #1493이 고침; 10-28 Windows 서명이 남아 열어 둠 |
| #249 #182 #175 #231 | lane drag, owl, area cycle, page note | 0회 재발,
고친 커밋 미확인: 원인 후보만 코멘트, 범위 밖 |
| #129 | close-policy ⌘W | 1회: 후보 앱 main process가 멈춤(teardown도 실패), 범위 밖
|
| #160 | agent-logo-peek | herdr fixture의 CLI 30 s 타임아웃(다른 spec에도 같은
서명), fixture 작업으로 넘김 |

의심했던 "data-pane-view 두 개"(#178)는 제품 결함이었습니다: 빈 그룹에서 연 새 터미널이 잠깐
Ungrouped에 놓여 두 pane이 같이 그려졌고, #1493이 core에서 고쳤습니다.

## Review

- **조심해서 볼 파일**: `web/src/components/ui/select.tsx` - 모든 Select가 닫힐 때의
focus 반환 경로입니다. Select root가 열림 상태와 trigger를 context로 내려 주고, content는
`useReturnFocus(open, { target: trigger })`로 반환합니다. 호출자가
`onCloseAutoFocus`에서 `preventDefault`하면(`AddProjectDialog`의 host 변경) 그쪽이
이깁니다.
- **조심해서 볼 파일**: `web/src/components/ui/layer.ts` - 모든 layer의 늦은 반환 보호.
반환 대상(trigger)을 감싼 surface가 focus를 가진 것은 "새 컨트롤"로 보지 않습니다. 고른 항목이 사라질 때
Settings 대화상자의 focus trap이 키보드를 대화상자 자체로 옮기는데, 첫 수정은 이것을 새 focus로 읽어 정상
닫힘에서도 trigger로 돌려주지 않았습니다(b72ba42 CI의 세 e2e 실패).
- **조심해서 볼 파일**: `desktop/e2e/pane-move.spec.ts`, `restoration.spec.ts`,
`project-settings.spec.ts` - 같은 원인을 가진 세 곳에 같은 대기를 넣었습니다.

## Evidence

- **확인한 것**: macOS desktop CI 기록 609개 report(294개 커밋)에서 이슈별 재발을 셈. #127의
3회 모두 End 뒤 13 그대로.
- **확인한 것**: 회귀 테스트 `web/src/components/ui/select.test.tsx`는 Settings처럼
대화상자 안의 실제 Select로 두 순서를 고정합니다. "고름 -> 새 컨트롤 focus -> 늦은 반환"은 수정 전
Select에서 실패(focus가 Select 버튼으로 감)하고 수정 후 통과합니다. "고름 -> 늦은 반환 -> trigger
focus"(정상 닫힘)는 `layer.ts` 수정 없이 실패(focus가 대화상자에 남음, CI e2e와 같은 증상)하고 수정
후 통과합니다. 테스트는 고정 대기 없이 fake timer로 Radix의 늦은 반환 타이머를 명시 실행하고, 그 전후에
`onCloseAutoFocus` 호출과 focus를 단언합니다. root는 `afterEach`가 정리합니다.
- **확인한 것**: `verify-web.sh` 전체 통과(web test 2251, desktop test 294,
lint, typecheck, build).
- **확인한 것**: `verify-web.sh desktop lint`, `desktop typecheck` 통과.
- **확인하지 못한 것**: desktop e2e 로컬 실행. 디스크가 5 GiB라 debug 빌드를 하지 않고, 이 PR의
macOS desktop job과 같은 커밋 반복으로 확인합니다.
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