Repository navigation
Answer tab requests from Herdr's moves, not the folded session - #674
Merged
Merged
Conversation
A session folds Herdr's events into one state, and one that ends on t2 cannot say whether Herdr went t2 or t2, t3, t2: a folded t2, t3, t2 answered only the first t2 and held Herdr's own moves for the deadline. The replica now keeps each tab_focused it applies as a move (the latest 16 and a count), and the core consumes the moves it has not read, each answering the earliest request on its tab. A snapshot read outside the stream answers nothing; dropped moves (over 16, a new replica) fall back to the tabs newly active and are logged. Which tab Herdr shows is one value, not one per workspace: Herdr emits tab_focused for another workspace's active tab. Each request records it as it leaves, a withdrawn request hands it to the next, and its answer settles it when it was already there. A refusal with no request left is reported, and the outstanding asks are collected once per reconcile.
This was referenced Oct 6, 2026
This was referenced Oct 7, 2026
yansfil
added a commit
that referenced
this pull request
Oct 7, 2026
…eir own field (#684) Related: #674 (리뷰 후속), #653 ## Summary #674 리뷰에서 나온 작은 후속입니다. 테스트가 중심이고, 동작은 두 곳만 바뀝니다. - (1) event stream 밖에서 읽은 snapshot이 아무 tab 요청에도 답하지 않는다는 것을 runtime 수준에서 고정합니다. - 대상: close나 creation의 fresh projection, editor status 응답처럼 `tab_moves`가 없는 snapshot. - t2 요청이 미답일 때 그런 snapshot이 t2를 보여도 미답 요청은 그대로입니다. 이동을 실은 다음 stream session이 답합니다. - (2) 표 test에 burst 행을 하나 더합니다: t1에서 t2를 두 번 누름(둘째는 lane에서 대기), 답 두 개, Herdr 이동 t2 하나. - 둘째 요청은 Herdr가 이미 t2에 있을 때 적용되어 event가 없습니다. 보낼 때 기록한 `herdr_before`로 답에서 정리되고, 3초 deadline을 기다리지 않습니다. - (3) replica의 이동 기록을 `ProjectionState`의 `Option`이 아니라 replica의 일반 필드(`SessionTabMoves`)로 옮겼습니다. - `tab_focused` 적용 때의 `expect` panic 경로가 사라집니다. - `state`는 Herdr의 topology만 담고, publish할 때 이동을 `published_state`에 얹습니다. held 상태에서 이동만으로는 publish하지 않는 #674의 규칙은 그대로입니다. - (4) `tab.focus.moves_gap`은 미답 요청이 있을 때만 남깁니다. - 미답 요청이 없으면 diff fallback으로 답할 것도 없습니다. 그래서 재연결마다 gap이 찍히던 것을 없앴습니다. - `docs/ARCHITECTURE.md`의 해당 문장도 고쳤습니다. ## Review - **조심해서 볼 파일**: - `herdr-core/src/session_sync/replica.rs` `refresh_published_state`: 이동을 얹는 자리가 여기 하나로 모였습니다. ready 경로는 이동만 바뀌어도 publish하고(전과 같음), held 경로는 이동만으로는 publish하지 않습니다. - `herdr-core/src/runtime/tab_focus.rs` `take_tab_focus_answers`: gap 분기에 미답 요청이 없을 때의 빈 분기가 생겼습니다. - **고치지 않고 남긴 것**(리뷰 지적, 이 PR 범위 밖): - held workspace의 hold에는 상한과 진단이 없습니다(`replica.rs` `refresh_published_state`의 held 경로). layout이 오지 않는 workspace는 그동안 이동을 실은 publish를 계속 막습니다. - 미리 온 focus(`early_focuses`)는 workspace마다 마지막 하나만 남습니다. 그래서 버려진 focus의 이동은 기록되지 않고, 그 요청은 뒤의 이동이 앞 요청까지 함께 지우지 않는 한 3초 deadline까지 남습니다. ## Evidence - **확인한 것**: - CI(97c8660) 19개 check 모두 녹색. rust workspace lane의 nextest는 1912개 통과, 11개 skip입니다. 새 test와 바뀐 test가 모두 이 lane에서 통과했습니다. - `view_authority_a_snapshot_read_outside_the_stream_answers_no_request` - `view_authority_the_screen_stays_on_the_last_request_whatever_order_herdr_answers_in`(11행) - `view_authority_dropped_moves_fall_back_to_the_tabs_newly_active`(미답 없는 재연결은 gap 없음) - `a_move_into_a_held_workspace_rides_on_the_publish_that_releases_it`, `every_applied_tab_focus_is_one_move_and_the_latest_are_kept`(replica 필드 이동 뒤에도 그대로) - rustfmt 통과(바뀐 세 Rust 파일). - **확인하지 못한 것**: - 로컬 compile, clippy, test는 돌리지 않았습니다. 디스크 여유가 8GiB 아래(6.7GiB)라 이 작업 규칙상 cargo 빌드를 하지 않았고, 위 CI 결과가 유일한 확인입니다. - 새 test가 수정 전에 실패하는지는 확인하지 않았습니다. (1)과 (2)는 #674 동작을 고정하는 test라 수정 전에도 통과해야 맞습니다. (4)의 마지막 단언만 수정 전에 실패해야 하는데, 이것은 로컬 빌드를 할 수 없어 확인하지 못했습니다.
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: #653, #667 (#667 리뷰 후속, main d13419b 위)
Related: #660 (fixed by #667; this keeps the order as a regression row)
Summary
#667은 checkout의 tab 권한을 "보낸 순서의 미답 tab 이동 목록"에서 유도합니다. 이 PR은 그 목록에 답하는 쪽을 Herdr의 이동 하나하나로 바꿉니다.
tab_focused하나를 이동 하나로 기록합니다(SessionTabMoves: 개수와 최근 16개).tab.focus.moves_gap을 log에 남깁니다.tab.focus해도tab_focused가 나옵니다. 그래서 "보이는 tab"은 workspace마다가 아니라 Herdr의 focused tab 하나입니다. #667의 workspace별 판단은 지웠습니다.tab.focus.refused로 보고합니다.TabAsks). 전에는 checkout마다 lane을 다시 훑었습니다.tab_focused가 그 workspace를 뺀 상태를 publish했습니다. 그래서 creation worker가 이미 projection한 pane이 retire되었고, Windows CI의hided_opens_a_pane_on_the_pinned_herdr_and_a_typed_line_echoes가 두 번 모두 실패했습니다.TAB_FOCUS_LIMIT상수 하나를 요청 목록과 이동 기록이 함께 씁니다), 3초 deadline, shell wire와 snapshot 계약. 새 timeout과 sleep은 없습니다.Review
RemoteSessionSnapshot)에는 tab 요청 목록이 없어 이동을 싣지 않았습니다. 소비자가 없는 필드를 만들지 않으려는 선택입니다.herdr-core/src/runtime/tab_focus.rstake_tab_focus_answers,withdraw_tab_move,settle_where_herdr_already_was: Herdr/core ownership 경계입니다.herdr-core/src/session_sync/replica.rs:tab_focused적용 시 기록합니다. partial publish에는 그때까지의 이동이 실리지만, 이동만 바뀐 것으로는 partial publish가 일어나지 않습니다(refresh_published_state). 이동이 publish를 일으키면 held topology가 creation worker의 projection을 되돌립니다.herdr-core/src/sidebar.rsSessionTabMoves::since: 틈 판정을 맡습니다.tab_focused마다 문자열 하나를 넣고 17번째를 버립니다.Evidence
view_authority_the_screen_stays_on_the_last_request_whatever_order_herdr_answers_in은 10행입니다. #667의 답 규칙을 그대로 되돌려 돌린 결과:view_authority_dropped_moves_fall_back_to_the_tabs_newly_active: 16개 초과와 generation 변경 두 경우 모두 diff로 물러서 요청을 답하고, 각각 gap 진단을 하나씩 남기는지 확인합니다. #667에서는 진단이 없어 실패합니다.view_authority_a_refused_tab_focus_keeps_the_tab_and_reports_it: deadline 뒤에 온 거절도 보고합니다. #667에서는 보고 1건으로 실패합니다.every_applied_tab_focus_is_one_move_and_the_latest_are_kept: 순서, cap, 틈 판정, raw snapshot에는 이동이 없음을 확인합니다.view_authority_answers_confirmed_ahead_of_their_events_are_not_followed(같은 순서, 옛 session 모양)를 그대로 돌린 결과:agent-tab-groups--repeat-each 60 --retries 0): Derive tab focus authority from one list of sent, unanswered requests #667 직전 main acc80875에서 4/60 실패(TEMP TEMP flaky 660 evidence (do not merge) #671, run 37543522493), Derive tab focus authority from one list of sent, unanswered requests #667 뒤 main d13419b9에서 0/60(TEMP TEMP flaky 660 evidence for #674 (do not merge) #676, run 37545543305). 이 PR head 18788eef를 main 5a8d59b2에 merge한 ref에서 0/60(TEMP TEMP flaky 660 evidence for #674 (do not merge) #676, macos-15-arm64, desktopagent-tab-groups'edge drag splits'). 4/60의 실패는 모두 둘째 영역의 입력 글자 유실이었습니다. 증상은 #667이 이미 없앴고 이 PR은 회귀가 없습니다. 추가한 표 행은 #660의 순서를 이 PR의 이동 모델에서도 지키는 회귀 test입니다.a_move_into_a_held_workspace_rides_on_the_publish_that_releases_it: layout을 기다리는 새 workspace로의tab_focused는 publish하지 않고, 그 workspace가 풀리는 publish에 이동 하나가 실리는지 확인합니다. 고침을 되돌리면 "the move waits for the workspace it moved into"로 실패합니다.hided_opens_a_pane_on_the_pinned_herdr_and_a_typed_line_echoes가 재시도까지 두 번 모두 실패했습니다. hided 로그에pane.selection_retired("Retired pane w1:p1; the selected checkout is now empty")가pane_cwd.corrected보다 앞서 찍혔습니다. 같은 test가 통과한 main run에는 retire가 없습니다.github::tests::timed_out_gh_and_its_pipe_holding_helper_are_terminated는 전체 실행의 부하 아래에서 한 번 실패했고, 단독 재실행에서는 통과했습니다. 이 PR이 건드리지 않은 module입니다.workspace.focus도 있음, t1,t2,t1 burst는 순서대로 세 건.-D warnings와 fmt 통과. 단 Derive tab focus authority from one list of sent, unanswered requests #667 head(235480b) 위에서 잰 결과입니다. main(d13419b)으로 rebase한 뒤 충돌은 없었고, fmt만 다시 돌렸습니다.HerdrMovestest helper가 replica처럼 이동과 focus event를 붙입니다). 기대값은 바꾸지 않았습니다. 단 split checkout 확인 test의 설명은 "그 workspace가 tab을 보이면 확정"에서 "그 tab으로의 이동이 답"으로 바꿨습니다.view-bookmarks.spec.ts등)는 로컬에서 돌리지 않았습니다. 디스크 여유가 8GiB 아래라 hided를 다시 빌드하지 않았고, CI에 맡깁니다.