Skip to content

Fix pane navigation lifecycle and agent status - #120

Merged
yansfil merged 1 commit into
mainfrom
fix/pane-navigation-lifecycle
Sep 20, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/pane-navigation-lifecycle

Conversation

@yansfil

@yansfil yansfil commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Child panes now switch to their owning project, checkout, and tab before requesting focus.
  • Add Tab reuses only a project-exclusive Herdr workspace and creates a fresh workspace when projects are mixed.
  • Agent completion is tracked separately from idle/read state, so a newly opened agent appears as Seen / Idle.
  • Failed pane-selection notices now include a dismiss button alongside Retry.

Failed pane-selection notice with Retry and dismiss controls

An idle agent shown under Seen while completed work remains under Done

Review

  • 판단해 주세요: pane focus가 다른 checkout으로 이동할 때 core가 project context까지 함께 소유하는 해석이 맞는지 봐주세요.
  • 조심해서 볼 파일: herdr-core/src/runtime/session.rs, projects.rs, events.rs - core/Herdr ownership과 workspace 생성 경계가 바뀝니다.
  • 조심해서 볼 파일: herdr-core/src/sidebar.rs, model.rs - 완료 상태와 읽음 상태의 영속 모델이 분리됩니다.
  • 질문: 섞인 workspace를 발견하면 기존 workspace를 정리하지 않고 새 workspace를 만드는 정책이 기대와 맞나요?

Evidence

  • 확인한 것: Rust 전체 테스트 580개 통과, 6개 ignored. Swift 전체 테스트 503개와 디자인 계약 검사가 통과했습니다.
  • 확인한 것: 격리된 네이티브 번들에서 실패 배너의 X를 눌러 배너가 사라지고, idle agent가 Seen / Idle로 표시되는 것을 실제 창 스크린샷으로 확인했습니다.
  • 확인한 것: 회귀 테스트가 다른 checkout의 자식 pane focus, 프로젝트 전용 workspace 재사용, idle에서 done으로의 상태 전환을 검증합니다.
  • 확인하지 못한 것: 운영 중인 사용자의 Herdr workspace는 변경하지 않았습니다. 실제 혼합 workspace 대신 공식 socket 계약을 쓰는 core 회귀 테스트로 검증했습니다.

AI tooling: 대부분 AI 도구를 사용했고, diff, 전체 테스트 결과, 정확한 후보 번들/PID와 네이티브 화면을 직접 대조했습니다.

@yansfil
yansfil merged commit 66f5cc9 into main Sep 20, 2026
5 checks passed
@yansfil
yansfil deleted the fix/pane-navigation-lifecycle branch September 20, 2026 09:33
yansfil added a commit that referenced this pull request Oct 29, 2026
…wner flakes (#1813)

Closes with-hide/hide-private#119
Closes with-hide/hide-private#281
Closes with-hide/hide-private#118
Closes with-hide/hide-private#120
Closes with-hide/hide-private#201
Closes with-hide/hide-private#313
Related: with-hide/hide-private#189, with-hide/hide-private#288 (원인 미확정,
이 PR에서 닫지 않음)

## Summary

hided 통합 테스트의 core_move·remote_core·node_owner flaky와 macOS remote
mailbox nightly 실패를 원인에서 고칩니다.
제품 코드 변경은 하나: 두 writer가 같은 진단 로그에 쓸 때 기록이 서로 섞이던 것을, 기록 하나를 한 번에 쓰도록
고쳤습니다.
나머지는 테스트 쪽입니다: 상태 대신 짧은 시간이나 한 번의 읽기에 기대던 대기, 실패한 run이 남긴 바이너리로 찬 디스크,
macOS에서 runner의 `gh`가 fixture의 것보다 먼저 잡히던 PATH.
#189/#288은 재현되지 않아 범위에서 뺐고, lane이 이제 실패와 flaky run의 `rc-*` 로그를 남깁니다.
스크린샷 없음: 화면을 건드리지 않습니다.

<details><summary>이슈별 원인과 처리</summary>

- **#119** node_owner refusal: `writeln!`이 줄과 개행을 두 번 write해,
`record_now`와 writer 스레드 사이에 다른 기록이 끼었습니다(CI 로그에 refusal 줄 뒤로
`start.step`이 붙어 있음). 줄과 개행을 한 `write_all`로 씀.
- **#118** a_newer_app...: 기기 helper upload(디버그 `hided`·`hide` 각 140MB)가
30초 bound를 넘던 것. #1751이 이미 고쳤고, 이후 CI는 `upload sent 0, reused 3`, 약 9초에
ready. 이슈에 근거 코멘트.
- **#281** manifest refusal: #1751 이후 남은 두 실패. (a) move back이
rolled_back을 기록한 뒤 node role이 시작되는데(#962) 이 테스트만 role을 한 번 읽음 -> 모든 move
back rollback이 쓰는 `back_rolled_back` helper. (b) `os error 11`: fixture
renderer가 handshake와 첫 snapshot을 2초 socket read로 묶어, 호출자의 30초 wait를 즉시
실패시킴 -> read는 hang guard만, 실패 시 무엇을 기다렸는지 말함.
- **#120** linked state folder: 같은 job에서 `/tmp`가 `Disk quota exceeded`가
된 직후의 timeout. 앞선 실패 run마다 바이너리 약 0.9GB가 남은 탓 -> 남기는 run은 native
program을 지우고 로그만 남김. fixture가 만들어지기 전 setup이 실패한 run도 같음.
- **#313** a_failing_move_back_check...(이 PR의 첫 CI에서 발견): supervisor가
journal `done`을 move view가 `linking`을 벗어나기 전에 써서, 그 사이 요청이 `move_busy`로
거절됨 -> `forward_done`이 창의 move view `done`까지 기다림.
- **#201** macOS nightly(10-17 이후 매번 실패): core가 `not_logged_in`으로 답함.
macOS login shell의 `path_helper`가 시스템 폴더를 앞에 두어 runner의 `gh`가 먼저 잡힘 ->
fixture HOME의 `.zprofile` 등이 계정 PATH를 앞에 둠(web fixture의
`fixtureLoginShellPath`와 같은 방식).
- **node_owner `hide connect`**: 5초 wall-clock 단언은 부하에서 daemon 시작 시간을
쟀습니다(load 30에서 11.7초). 지우고, 종료가 다음 look에서 wait를 끝낸다는 것은
`wait_healthy_within`에 종료 신호를 주는 fake-clock 테스트로 증명. 통합 테스트는 파일과 이유만 봄.
- **#189/#288** remote_core 화면(같은 테스트): Linux remote_core 23개 x
8회(184회), 로컬 macOS 69회, nightly macOS 23/23에서 재현 없음. lane이 `rc-*`를 올리지
않아 증거가 메시지뿐이었음. 결과와 다음에 볼 곳은 두 이슈에 코멘트.

</details>

## Review

- **판단해 주세요**: renderer의 2초 read를 30초 hang guard로 바꾼 것은 대기 늘리기가 아니라, 첫
snapshot이라는 신호를 오는 즉시 읽고 시간 추측으로 실패하지 않게 한 것입니다(TESTING.md, Writing a
Rust test 5).
- **조심해서 볼 파일**: `herdr-core/src/diagnostics.rs` - failure path(시작 거부
기록)의 쓰기 방식.
- **조심해서 볼 파일**: `hided/tests/it/support/run.rs` - 남기는 run에서 ELF/Mach-O만
지우고 link는 따라가지 않음.
- **조심해서 볼 파일**: `.github/workflows/remote-mailbox.yml` - flaky run도 로그를
올림, `rc-*`는 `*.log`와 `Logs/*.jsonl`만(fixture 경로는 담김), artifact 이름에
attempt.
- **비용 검토**: 진단 기록 한 건마다 줄을 재사용 버퍼에 한 번 복사합니다(`writeln!`의 두 write 대신 한
`write_all`). 버퍼는 writer가 본 가장 긴 기록 크기에서 멈추고, 그 뒤 할당은 없습니다.

## Evidence

- **확인한 것**: 새 diagnostics 테스트가 예전 `writeln!`에서 3/3 실패(CI와 같은
`{...}{...}` 섞임), 고친 코드에서 통과.
- **확인한 것**: fake-clock 테스트에서 350ms에 종료한 daemon의 wait가 그 뒤 pause 없이 다음
look(425ms)에서 `exited with`로 끝남.
- **확인한 것**: 바뀐 core_move 7개 x 3회(21회) 로컬 macOS 실패 0, 남은 `/tmp/hcm-*`
없음. diagnostics·node_owner·run 20회 반복 실패 0(load 26~30).
- **확인한 것**: nightly `lane=macos` dispatch(run 40725749658)의 remote
mailbox macos-15 첫 시도 통과: remote_core 23/23(#201 테스트 포함), core_move
44/44, flaky 0.
- **확인한 것**: PR CI Linux remote mailbox: core_move 44/44, remote_core
23/23, flaky 0.
- **확인하지 못한 것**: #189/#288 원인(Linux CI에서만 약 8% run에서 실패, stress 184회 재현
없음).
- **확인하지 못한 것**: #201 수정 전 실패의 로컬 재현(이 Mac의 `/etc/paths` 폴더에 `gh`가 없음).
같은 nightly run의 web e2e macOS 실패는 이 diff와 무관.
- **확인하지 못한 것**: windows check의 web 단위 테스트
`web/src/practice/worlds.test.ts` 5초 timeout(이 diff와 무관)은 실패 job만 한 번
재실행해 통과.

<details><summary>Verification record</summary>

- Head: `def885735` (review fix on top of `c9290db54`)
- Base: `origin/main` (merge-order: Stay as you are)
- Local, macOS arm64: `cargo nextest -p herdr-core -p hided`
diagnostics·wait·node_owner 테스트 72/72 pass, 새 테스트 둘과 node_owner 20회 반복
실패 0, exit 확인을 deadline 뒤로 옮기면 새 cli 테스트 실패; clippy `-D warnings` 0
warnings, `cargo fmt --check` clean.
- Local, macOS arm64: core_move 7개(manifest, newer app, linked state,
failing move back, move back window, issues through move, staging
failure) x 3 = 21/21 pass at c9290db.
- CI: verify run 40729811159 at c9290db 39/39 pass (windows check 1회
재실행); nightly `lane=macos` run 40725749658 remote mailbox macos-15 pass.
- Temporary stress (51af1e7, reverted in c9290db): remote mailbox
ubuntu job 122933565889, remote_core 23 x 8 = 184 pass.
- Review fix (this head): node_owner fake-clock exit test, reused log
buffer, `rc-*` log allowlist.
- Changed paths: `herdr-core/src/diagnostics.rs`, `hided/src/cli.rs`,
`hided/tests/it/{node_owner,core_move}.rs`,
`hided/tests/it/support/{core_move,run}.rs`,
`hided/tests/it/support/remote_delivery/{mod,renderer}.rs`,
`.github/workflows/remote-mailbox.yml`.

</details>
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.

1 participant