Repository navigation
Ingest a session update before the stream focus readback is answered - #468
Merged
Merged
Conversation
This was referenced Oct 5, 2026
yansfil
added a commit
that referenced
this pull request
Oct 5, 2026
…t, removing two @flaky tags (#492) Closes #287 Related: #416 (열어 둠: main 연속 2회 녹색 뒤 닫음) ## Summary 두 e2e의 `@flaky`를 지웁니다. 제품 코드는 바꾸지 않습니다. - #287: 원인은 테스트의 준비 조건이었습니다. chip 클릭 직후 자식 pane view가 먼저 focus되지만 코어가 그려 주는 canvas는 아직 부모 탭이라, 그 탭을 누르는 일은 아무것도 보내지 않습니다. 곧이어 Herdr 확인이 오면 canvas가 자식으로 바뀌어 `data-pane-view=<parent>`가 안 보입니다. 이제 부모 탭이 `aria-selected=false`가 될 때(위임 canvas가 그려질 때)까지 기다린 뒤 누릅니다. - #287의 순서 계약은 별도 test로 분리했습니다. chip의 `pane.focus`를 `herdrGate`로 붙잡고, 그동안 부모 탭을 눌러 `agent_layout.focus`가 한 번 가고 부모가 남는지 봅니다. 풀어 준 뒤에는 대기하던 `tab.focus`가 Herdr에 닿을 때까지 기다려 늦은 답이 처리된 뒤의 상태를 읽습니다. - #416: 계약 세 개로 쪼갰습니다(폭 180 유지, 단계별 축소와 되돌림 대칭, 선택 탭 제목 이동과 스크롤 중 선택 탭 보임). 단언은 그대로이고 helper(`startStrip`, `check`)를 공유합니다. ## Review - **판단해 주세요**: #416은 시그니처 A(Linux, 탭 15/16)의 원인을 찾지 못해 `Closes`가 아니라 `Related`로 두었고, issue는 main 연속 2회 녹색 뒤 닫습니다. - **판단해 주세요**: #416 시그니처 B(macOS rAF 정지)는 두 run 모두 headless WebGL 비활성화(`236fb6f4`) 이전입니다. 그 수정으로 설명된다는 근거는 시점 비교뿐이고, 같은 SHA 대조는 없습니다. - **조심해서 볼 파일**: `web/e2e/agent-tab-groups.spec.ts` - 새 gate test가 늦은 `pane.focus` 답과 대기 중인 `tab.focus`의 순서를 단언합니다. ## Evidence - **확인한 것**: 같은 test를 CPU 부하(`yes` 4개) 아래에서 반복했습니다. #287 두 test 40/40(수정 전 변형은 부하 없이 3/10 실패), #416 세 test 24/24, 리뷰 반영 뒤 네 파일 묶음 50/50. eslint와 tsc 통과. - **확인한 것**: #416 A 재현 시도는 탭 16개 생성만 30/30(부하), 원본 전체 5/5(부하)로 모두 통과했습니다. - **확인하지 못한 것**: #416 시그니처 A의 원인. 해당 run들은 control lane(#438)과 ingest 수정(#468) 이전이라 그 수정들로 사라졌을 가능성이 있지만 확인하지 못했습니다. 재발하면 retry 1회 분류가 새 flaky issue를 만듭니다. - **확인하지 못한 것**: macOS와 Windows, CI 러너 부하에서의 반복. gate가 요청을 붙잡는 구간이 `pane.focus` 5초 기한 안인지는 로컬에서만 봤습니다. - 쪼갠 대가: #416 16탭 test 두 개가 각각 스택을 새로 시작하고 탭 13개를 만듭니다. 대신 한 계약이 흔들려도 다른 계약과 분리돼 실패합니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #424 (s2 flaky, closing condition below); #438 (control lane; its CI showed the same delay and it is not the cause); #447, #449, #450 are independent.
Summary
The local session coordinator read Herdr's focus (
pane.layoutthenworkspace.get, 5 s each) before it ingested a session update whose focused pane differed from Hide's.That read ran on the coordinator thread, so a pane close, a zoom or a resize behind it reached the screen only after Herdr answered, up to ten seconds late, and the next stream delta waited behind it too.
Now the update is ingested at once, and only the differing focus (with the zoom of the pane it names) stays Hide's until the read answers.
The read runs on its own worker outside
Mutex<Runtime>, one at a time, and a confirmed answer applies the layout the session already stored.The 5 s deadline is unchanged and nothing waits longer: the order of read and ingest is state now (
pane_focus_readback, one slot the runtime takes under the lock and the worker frees on every way out).Separate commit
0c2a2f35(asked for in review of #438): a lost answer that discards waiting tab or pane focus controls now records the number dropped and the request whose answer was lost in the diagnostics.Review
herdr-core/src/runtime/session.rs- runtime mutex and ownership:ingest_session_awaiting_focus_readbacktakes the slot under the lock,finish_pane_focus_readbackre-checks serial, generation and pending requests before it adopts, and hands the worker the next read only when the stored layout still shows a move.herdr-core/src/session_sync/coordinator.rs- failure path:spawn_focus_readbackfrees the slot on a panic, a poisoned lock, a dropped runtime and a failed thread start; the read itself is the sameconfirm_pane_focus.herdr-core/src/runtime/control_lane.rs- failure path (separate commit, asked for in review of Send local Herdr tab and pane controls through one ordered lane #438): a lost answer that discards waiting focus controls now records how many (tab.focus.unknown,pane.focus.dropped, including the pane-after-pane case that recorded nothing) and whose answer it was (target, request id, serial in the diagnostic line);control_order.rsasserts the counts.Evidence
Test that a pane close is ingested ...): with FakeHerdr holdingpane.layout, the runtime's layout still had the closed pane after Herdr had been asked (["w1:p1","w1:p2","w1:p3"]against["w1:p1","w1:p2"]). It passes with the fix, and the same test locksMutex<Runtime>while Herdr still holds the answer, then releases and checks the focus and zoom are followed.session_sync/coordinator.rs), and four inruntime/tests/session_navigation.rs(stale stream, a new selection or connection outlives an answer, one read outstanding and a superseded one hands on, an answer for another tab than the selected one cannot pull focus back; the last fails without its guard). The old three readback tests were rewritten onto the new calls.scripts/verify-cargo.sh test -p herdr-core --lib: 1397 passed;lintandfmt-checkclean;scripts/check-capability-readers-off-lock.shpasses.Closing conditions. #424 and the s2:55 flaky issue are not closed by this PR.
Close them when
mainis green on the same lane (web e2e, retry 0, existing deadlines) for 2 consecutive runs after this merges and the@flakytag is gone; if s2:55 fails again after that, the cause stays open on #424 and this PR is not the cause to blame twice.