Skip to content

새 탭을 연달아 두 번 만들면 탭 하나가 유실된다 #400

Closed

Description

@yansfil

What happened

새 탭 단축키(new_tab)를 연달아 두 번 누르면 탭이 하나만 생기고 하나가 사라집니다.
web/e2e/checkout-owner.spec.ts의 두 test가 같은 assertion 시그니처로 실패합니다: twoQuickNewTabs 뒤 expect(tabs).toHaveCount(3, { timeout: 20_000 })에서 Expected 3, Received 2.
Playwright call log는 20초 내내 탭 2개(1개에서 2개까지는 늘어남)를 보여, 두 번째 탭이 늦게 오는 것이 아니라 오지 않습니다.

run (attempt) SHA 위치 test
37214499584 (1) PR #398 Linux shard 1, :80 -> :99 With no workspace bound, Herdr binds the unbound one already at the checkout, and Hide leaves its name
37182041622 (1) main 987778a Linux shard 1, :163 -> :176 A new tab in a plain folder opens one marked workspace and the next tab reuses it
37180917551 (1) PR #380 50861a0 Linux shard 1, :80 With no workspace bound, … (attempt 2는 통과)

PR #380은 같은 SHA에서 attempt 1 실패, attempt 2 통과였으므로 flaky로 확인됩니다.
Windows web/e2e/s2.spec.ts:138의 ⌥T 뒤 toHaveCount(4)에서 Received 3이 났다는 제보가 있습니다(같은 모양의 탭 하나 유실로 보임, 이 issue 작성 시 run 링크는 확인하지 못함).
관련 가능: #308 (프로젝트 메뉴에서 만든 탭이 탭 줄에 오지 않음).

What you expected

새 탭 요청 두 번은 탭 두 개가 됩니다. 사용자가 요청한 탭은 유실되지 않습니다.

Steps to reproduce

  1. Linux runner에서 bash scripts/verify-web.sh web e2e e2e/checkout-owner.spec.ts를 실행합니다.
  2. 간헐적으로 :99 또는 :176에서 Expected 3, Received 2로 실패합니다.

로컬 재현과 원인 조사는 이 issue에서 하지 않았습니다.
원인 수정은 브랜치 fix/rapid-new-tab-intent에서 진행 중입니다.

Versions

Activity

  1. added
    bug
    on Oct 4, 2026
  2. yansfil commented on Oct 4, 2026

    @yansfil
    ContributorAuthor

    재현 시도 기록 (원인 수정 세션, 2026-10-05)

    재현 규칙(로컬, 그다음 CI dispatch 최대 2회)에 따라 시도했고 재현되지 않아 여기서 멈춥니다.

    기존 실패 로그에서 확인한 것

    • 입력은 유실되지 않았습니다: 두 실패(nightly 00706f8 folder, PR Quarantine the repeated main failures and keep the original Windows fixture error #398 adopt) 모두 create_tab 2회 전송, tab.create.requested 2회, owner.tab_created 2회입니다.
    • Herdr에는 두 탭이 모두 생겼습니다: Herdr 세션 로그에서 adopt는 w1:t2, w1:t3, folder는 w2:t1, w2:t2가 의도한 owner에 생성됐습니다.
    • PR Quarantine the repeated main failures and keep the original Windows fixture error #398 실패에서 hided replica는 기대한 이벤트 15개를 모두 적용했습니다(applied_events: 15).
    • 따라서 남는 가설은 세 번째, "Herdr에는 두 탭이 있지만 projection 또는 표시에서 하나가 빠짐"입니다.
    • 실패 시도에만 있고 통과 시도에는 없는 신호: 두 생성 응답 뒤 pane.focus.followed(Hide가 새 pane에 있다가 생성 이전 pane w1:p1로 이동)와 tab.visible_aligned가 기록됩니다.
    • folder 실패에서 Herdr는 그 시점에 w1:p1을 focus하지 않았으므로, Hide가 Herdr의 현재 상태가 아닌 오래된 projection의 focus를 외부 focus로 받아들였습니다.
    • folder 실패에서는 첫 응답이 두 번째 요청의 탭(w2:t2)이었고, 그 뒤 첫 요청의 응답이 왔으며, w2:t1에 대한 view_focus.timed_out이 남았습니다.
    • 기록된 실패 세 건은 모두 Linux 전체 suite의 shard 1에서 났습니다.

    재현 시도와 결과

    방법 결과
    로컬 macOS, 두 test 반복, workers 2~12 0/62 실패
    첫 owner open worker를 지연시켜 응답 순서를 뒤집음(임시 계측) 순서 역전은 재현, 탭 유실 0/7
    hided를 background QoS로 실행 0/12
    Herdr 이벤트 스트림 읽기에 지연 주입(임시 계측) 0/8
    core 단위 실험: 응답 뒤 생성 이전 세션을 끼워 넣음(adopt, folder 모양) 최종 표시 3개로 수렴
    CI dispatch 1: Linux 4 shard, 두 test만, repeat 10, retry 0, 계측 빌드 (37217213560) 0/20
    CI dispatch 2: 같은 조건, repeat 25 (37217449327) 0/50

    Herdr socket을 직접 구독한 probe에서 두 tab.create를 연달아 보내도 각 탭에 tab_created, pane_created, layout_updated가 순서대로 왔습니다.

    다음에 필요한 것

    • 실패 조건은 shard 1에서 앞선 test들이 먼저 돈 뒤일 가능성이 있습니다. 두 test만 떼어 돌린 CI dispatch는 그 조건을 재현하지 못했습니다.
    • 다음 시도는 probe 계측(세션 수신마다 Herdr 탭, checkout 탭, strip, Agent layout 표시, replica partial publish 상태 기록)을 shard 1 전체 순서 그대로 돌리는 것입니다. 계측 커밋은 probe/rapid-new-tab 브랜치에 있습니다.
    • 또 하나의 확인된 결함 후보는 replica partial publish가 차단된 workspace의 이전 focus를 내보내고, runtime이 그것을 Herdr의 외부 focus로 따라가는 경로(replica.rs focused_pane_for_partial_publish, session.rs report_followed_pane_focus)입니다. 이것이 탭 유실까지 이어지는지는 아직 증명되지 않았습니다.
  3. yansfil commented on Oct 4, 2026

    @yansfil
    ContributorAuthor

    재현 성공과 원인 층 (2026-10-05)

    Linux shard 1/6 순서를 여섯 벌 돌린 계측 run 37242379943의 copy 3에서 checkout-owner.spec.ts:38이 기대 4, 실제 3으로 실패했습니다.

    • Herdr에는 새 탭 두 개(w1:t2, w1:t3)가 모두 있었습니다.
    • 빠진 탭 w1:t2는 hided projection에서 fixture checkout이 아니라 fixture의 부모 폴더(/tmp/hide-e2e-herdr-*)라는 별도 checkout에 배정됐고, 20초 동안 그대로였습니다.
    • 탭의 checkout은 그 pane의 cwd로 정해지고(runtime/session.rs의 find_workspace_for_context), git 밖 폴더는 cwd 자체가 project 경로가 되므로, 이 pane의 cwd가 그 순간 fixture 부모 폴더로 projection에 들어왔다고 봅니다.

    확인했지만 이 실패를 고치지 못하는 것

    • #380은 agent.list의 live cwd로 pane cwd를 보정합니다. 그러나 고정된 Herdr v0.9.1의 agent.list는 plain shell pane을 돌려주지 않습니다(격리 Herdr에서 herdr agent list 결과 [], pane list에는 두 pane이 cwd와 함께 있음, 소스 src/app/agents.rs agent_info는 agent terminal만 반환).
    • 따라서 agents: false fixture의 새 탭은 Refresh a pane's live cwd from the agent list #380 경로로 보정되지 않습니다. tick 조건을 바꾸는 수정은 단위 테스트로는 맞지만 이 실패에는 효과가 없어 PR로 내지 않았습니다.
    • Herdr v0.9.1에서 plain pane의 cwd 변화는 이벤트로 오지 않습니다(pane_updated는 title, agent, metadata 변화에만 발생).

    아직 모르는 것

    • 그 pane의 cwd가 정확히 어떤 값이었는지, 그리고 어디서 왔는지는 기존 로그에 없습니다. Herdr 소스(cwd_for_pane)는 live /proc/<pid>/cwd가 있으면 그것을, 없으면 요청한 cwd를 돌려줍니다.
    • probe/rapid-new-tab에 탭별 pane cwd 기록을 추가해 두었습니다. 한 번 더 같은 계측 run을 돌리면 값을 확정할 수 있습니다.
  4. added
    quarantine
    on Oct 5, 2026
  5. added a commit that references this issue on Oct 5, 2026
    2418653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugquarantine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions