Repository navigation
Keep a pane on its reported session when a same-cwd neighbour is newer - #100
Merged
Merged
Conversation
…t is newer SessionLocator::locate let the newest session file in the same cwd override the session Herdr reported for a pane once the reported file had been quiet for 30 s. With two Claude panes in one checkout, the idle pane was then read, named, and labelled from the busy pane's transcript. A reported id now wins outright; the newest-by-cwd search remains only for panes without a reported id or whose reported file is missing. A session switched in place is reported again by the runtime hook, so the freshness rule bought nothing.
1 task
yansfil
added a commit
that referenced
this pull request
Sep 19, 2026
## Summary PR #100 이후에도 새 pane이 잠깐 옆 pane의 이름을 받는 경우가 남아 있었습니다. Claude가 뜨고 첫 턴을 쓰기 전까지는 Herdr가 세션 id를 이미 보고하는데 JSONL 파일은 아직 없고, 그 `SessionFileMissing`에서 같은 cwd의 최신 파일로 떨어지는 fallback이 살아 있었습니다. 실측: `w7J:p37` 분석 요청 09:18:11(`input_chars=2008`) → 그 pane의 세션 파일 생성 09:18:30 → 첫 턴 전까지 이웃 세션의 이름을 달고 있었음. 바꾼 것: 보고된 세션은 자기 파일로만 해석되고, 없으면 `session_file_missing`으로 끝납니다. cwd 최신 파일 탐색은 Herdr가 세션을 전혀 기록하지 않은 pane에만 남습니다. 플러그인 README의 이름 규칙에 이 경우와 대기 중 남는 로그 줄(`raw_session_unavailable` / `session_file_missing`)을 적었습니다. ## Related - PR #100 (30초 freshness fallback 제거)의 마무리. ## Review focus - **사람이 판단할 것**: 없음. 사용자가 "이름 붙이지 않는다"를 선택했고 README가 이미 그렇게 말하고 있었습니다. - **위험한 파일**: `hide-session/src/lib.rs` `locate`의 identity 분기. Codex도 같은 경로를 타므로 rollout 파일이 아직 없는 Codex pane도 첫 턴까지 이름 없이 기다립니다. ## Risk surface - **Failure path**: 파일이 생길 때까지 pane마다 tick당 `raw_session_unavailable` 로그 한 줄이 남고 토큰은 발행되지 않습니다. 기존 `session_kind_unsupported`와 같은 경로입니다. 이외 항목은 해당 없음: watcher 프로세스 안의 순수 경로 해석입니다. ## Evidence - **확인한 것**: `hide-session` 새 테스트(파일이 없으면 `SessionFileMissing`, 생기면 같은 pane이 자기 파일로 해석) + 플러그인 테스트 1개 추가(`session_file_missing`), 기존 cwd-fallback 테스트 2개는 "세션 미보고 pane" 케이스로 범위를 좁힘. `scripts/verify-cargo.sh test`/`lint` 통과. - **확인하지 못한 것과 그 이유**: 실기기 재현은 머지 후 플러그인 재설치 뒤 새 Claude pane을 열어 첫 턴 전에 이름이 비어 있는지로 확인합니다. ## AI tooling - [ ] 사람이 직접 작성 - [ ] 일부를 AI 도구로 작성 - [x] 대부분을 AI 도구로 작성 **손으로 확인한 것**: watcher `events.jsonl`의 요청 시각과 세션 파일 birth time을 대조해 fallback 경로를 특정했습니다.
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.
Summary
한 checkout 안에 Claude pane이 둘 있으면, 조용한 쪽 pane이 30초 뒤부터 바쁜 쪽 pane의 transcript로 읽혔습니다.
SessionLocator::locate가 Herdr가 보고한 session id의 파일이 30초 이상 조용하면 같은 cwd의 가장 최신 파일로 갈아탔기 때문입니다.PR #99 배포 검증 중 새 pane
w7J:p34가 처음엔 제 이름(README.md 첫 줄 요약)을 받았다가 곧 이웃 세션의 이름과 task로 덮어써지는 것으로 발견했습니다(watcher 로그의input_chars=4044가 이웃 세션 파일을 읽었음을 보여줌).바꾼 것: 보고된 id의 파일이 있으면 그 파일을 무조건 씁니다.
newest-by-cwd 탐색은 보고된 id가 없거나 그 파일이 없는 pane에만 남습니다.
REPORTED_SESSION_FRESHNESS와is_recent는 쓰는 곳이 없어져 삭제했습니다.Related
plugins/agent-context-labels/README.md:291의 "세션을 기록하지 않은 pane은 이름을 붙이지 않는다"는 규칙과 같은 이유입니다.Review focus
/clear,--resume) runtime hook이 새 id를 다시 보고하므로 stale id는 hook 경로로 이미 갱신된다"입니다. 그 가정이 틀린 경로가 있으면 알려주세요.hide-session/src/lib.rslocate의 분기 하나뿐입니다.Risk surface
SessionFileMissing→ cwd 탐색으로 내려갑니다. 변경 없음.이외 항목(mutex, wire, ownership, contract, high-frequency)은 해당 없음: 이 코드는 플러그인 watcher 프로세스와 usage fallback에서만 돌고
Mutex<Runtime>밖입니다.Evidence
a_reported_session_is_kept_when_a_neighbour_in_the_same_cwd_is_newer- 보고된 파일 mtime을 10분 전으로 두고 같은 디렉터리에 더 새 파일을 만들어도 보고된 파일이 돌아오고, id 없이 물으면 여전히 최신 파일이 돌아옴.scripts/verify-cargo.sh test전체 통과(hide-session 11, 워크스페이스 합계 0 실패),scripts/verify-cargo.sh lint통과.herdr plugin install ... --yes) 뒤에 확인합니다. 워크트리에서 빌드한 watcher를 운영 소켓에 붙이면 지금 도는 watcher와 lock이 충돌합니다.AI tooling
손으로 확인한 것: 검증 pane의 토큰이 시간차로 바뀌는 것을
herdr pane read로 두 번 관찰했고, watcher 로그의 input_chars로 어느 파일을 읽었는지 대조했습니다.