Skip to content

Hold a tab focus confirmed ahead of Herdr's report as a late answer - #673

Closed
yansfil wants to merge 1 commit into
mainfrom
fix/flaky-660
Closed

yansfil wants to merge 1 commit into
mainfrom
fix/flaky-660

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #660

Summary

Agent edge drag splits the desktop column into two live tab groups에서 두 번째 Agent 영역에 친 글자가 중간에 빠졌다(desktop-group-live가 desktp-gp-live, desktop-glive로 도착).
원인은 테스트가 아니라 core의 탭 포커스 판정이다. 드롭(t2), 첫 영역 클릭(t1), 둘째 영역 클릭(t2)이 이어질 때 Herdr의 성공 응답은 세션 스트림보다 앞서 온다.
t1 클릭은 응답 시점에 Hide가 마지막으로 읽은 세션(드롭 전)이 t1을 보여 "응답으로 확인"됐지만, Herdr는 그 뒤에 t2(드롭)와 t1(클릭)을 차례로 다시 알린다.
그 늦은 t1 알림이 둘째 영역에 타이핑하는 도중 도착해 Herdr 자신의 이동으로 따라졌고, 키보드가 첫 영역으로 170~250 ms 넘어갔다 돌아왔다.
이제 같은 checkout의 이전 요청이 아직 superseded로 남아 있을 때 응답으로 확인된 탭도 superseded로 기억해, 그 늦은 알림을 그 요청의 답으로 소비한다.

Review

  • 조심해서 볼 파일: herdr-core/src/runtime/session.rs confirm_tab_focus_already_shown - Herdr/core ownership(탭 포커스 권한). 확인은 그대로 하고, superseded가 남아 있을 때만 확인된 탭을 같은 목록(최대 16개, 3초 만료)에 더한다.
  • 판단해 주세요: 확인된 탭의 알림이 따로 오지 않으면(한 burst로 묶여 발행되면), 더한 항목이 3초 동안 그 탭으로의 진짜 외부 이동 하나를 소비할 수 있다. 기존 superseded 항목과 같은 한계다. 대안(확인하지 않고 알림을 기다림)은 그 경우 3초 대기와 view_focus.timed_out을 남긴다.
  • 비용 검토: 탭 포커스 응답마다 superseded 목록(최대 16) 한 번 훑기. 고빈도 경로 아님.

Evidence

  • 확인한 것: 두 실패 CI 시도(PR Stop Codex's running shared server when the operator turns it off, so a hand-started Codex runs in its own pane #656, Name the core's own machine by its node id and convert stored state once #664, macOS)의 hided 로그가 같은 순서다: confirmed_by_answer t1 -> late_answer t2 -> confirmed_by_answer t2 -> followed t2->t1 -> followed t1->t2, 두 follow 사이에 둘째 영역 타이핑.
  • 확인한 것: 그 순서를 그대로 재생하는 core 테스트 view_authority_answers_confirmed_ahead_of_their_events_are_not_followed. TEMP CI에서 수정 없이 실패(늦은 t1이 탭을 t2에서 t1로 옮김, 두 번 모두), 수정 후 결과: 통과(herdr-core 1600개 모두 통과, retry 없음).
  • 확인한 것: TEMP CI(macos-15-arm64, retry 0, --repeat-each 60) main에서 60회 중 4회 실패, 모두 둘째 영역 입력의 글자가 빠짐(deskt-group-live, n'deskto-group-live 등), 4회 모두 hided 로그가 위와 같은 순서. 수정 후: 같은 조건 60회 모두 통과.
  • 확인하지 못한 것: 로컬 빌드와 테스트. 디스크 여유가 빌드 기준(8 GiB) 아래라 모든 실행(clippy 포함)을 CI에서 했다.

A success answer confirms a tab focus when the session Hide last read
already shows its tab. While an older request to the same checkout is
still remembered as superseded, that session predates the older one:
Herdr reports the older tab and then this one again. The confirmed tab
is now remembered as superseded too, so its report is consumed instead
of followed after the operator has moved on; following it moved the
keyboard to the other Agent area in the middle of typed input.
@yansfil

yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #674. The diagnosis and the core reproduction for #660 move there, onto the single unanswered-request list #667 introduced; #674 closes #660.

@yansfil yansfil closed this Oct 6, 2026
@yansfil
yansfil deleted the fix/flaky-660 branch October 19, 2026 06:51
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.

Flaky test: Agent edge drag splits the desktop column into two live tab groups

1 participant