Repository navigation
Keep the Agent cycle's recent pane order across restarts - #513
Merged
Merged
Conversation
The page still decides what a pane visit is, since only it knows where the keyboard is, but now reports each visit with pane_visit. The core keeps the order in ui_state.recent_pane_ids (fifty panes, newest first), saves it with the UI state, and the Agent cycle reads it from the snapshot, so a reload, quitting the app and a daemon restart keep the panes visited before.
…ane order's owners The shared-save tests sent a hand-built ui_state_update that failed to decode, so the carry-through was never exercised; they now send the web's whole-state echo. The navigation row in docs/README.md names the new core owner and specs, and Recent Navigation scopes session-local history to Recent Panels and Recent Projects.
yansfil
added a commit
that referenced
this pull request
Oct 5, 2026
…choes it (#548) Refs #540 ## Summary #513이 들인 회귀를 고칩니다. Agent pane cycle이 방금 옮긴 pane이 아니라 그 전 pane에서 시작하던 문제입니다. - #513과의 관계: - #513은 Agent cycle의 최근 pane 순서를 page 메모리에서 core(`ui_state.recent_pane_ids`)로 옮겼습니다. page는 방문마다 `pane_visit`을 보내고, cycle은 snapshot의 순서를 읽습니다. - #513 전에는 page의 순서가 keyboard가 옮겨 간 frame에서 바로 바뀌었지만, 지금은 core가 그 `pane_visit`을 반영한 snapshot이 올 때 바뀝니다. - 그 사이에 cycle을 열면 옛 순서를 읽어 그 전 pane이 맨 앞입니다. - #540의 실패(`recent.spec.ts:181`, 기대 `w2:p1`, 실제 `w1:p1`)는 cycle로 `w2:p1`에 옮긴 직후, sidebar에서 다시 cycle을 연 단계였습니다. #513 머지 직후 첫 queue run에서 처음 났습니다. - 수정(`web/src/recent.ts`): - page는 보낸 방문과 그때의 core 순서를 기억합니다. core 순서가 그 뒤 움직이기 전까지 보낸 pane을 맨 앞에 둔 순서를 읽습니다. - core 순서가 한 번 움직이면 다시 core의 순서를 그대로 씁니다. 다른 창의 방문이 core의 맨 앞을 바꾸는 경우도 core가 정합니다. - 순서의 주인은 그대로 core이고, page는 자기가 보낸 쓰기를 echo 전에 읽을 뿐입니다. - 문서: `docs/UI_BEHAVIOR.md`와 `docs/ARCHITECTURE.md`의 순서 문장에 echo 전의 읽기를 더했습니다. ## Review - **판단해 주세요**: core가 거절한 방문(목록에 없는 pane)은 core 순서를 움직이지 않으므로 page가 그 pane을 맨 앞으로 계속 읽습니다. 그런 pane은 cycle 행이 되지 않아(세션에 없는 pane은 빠짐) 보이는 차이는 없다고 봤습니다. - **조심해서 볼 파일**: `web/src/recent.ts` - failure path. `unechoedVisit`은 순서가 움직였다고 처음 본 순간 기다림을 끝냅니다. 순서가 처음 값으로 돌아와도 다시 살아나지 않게 하려는 것이고, 기존 test 하나가 그 경우를 잡았습니다. ## Evidence - **확인한 것**: 결정적 test를 먼저 썼고, 수정 전 실패를 확인했습니다. - test: `areaCycle.test.ts` "starts at the pane the page just reported, before the core echoes it, then follows the core" - echo를 붙잡은 채 cycle을 열면 수정 전에는 CI와 같이 `['t2-pane', 'other-tab-pane']`(옛 순서)였고, 수정 후에는 보낸 pane이 맨 앞입니다. - echo 뒤와 다른 창의 방문 뒤에는 core의 순서를 따릅니다. - **확인한 것**: web typecheck, lint(e2e 크기 예산 포함), unit test 1033개 통과. - **확인한 것**: 로컬 macOS, CPU 부하(`yes` 6개) 아래에서 다음을 반복했습니다. - `recent.spec.ts` 8/8 통과 - #513의 `recent-agents-restart.spec.ts` 5/5 통과 - **확인하지 못한 것**: 로컬 e2e로 수정 전 실패를 재현하지는 못했습니다. 수정 전 build로도 같은 부하에서 12/12 통과했고, 이 Mac에서는 echo까지의 틈이 짧습니다. 재현은 위 unit test가 맡습니다.
yansfil
added a commit
that referenced
this pull request
Nov 4, 2026
Refs with-hide/hide-private#513 ## Summary Windows에서도 새 엔진으로 일곱 종류의 에이전트를 시작하고, 셸에서 직접 실행한 프로그램을 알아볼 수 있게 합니다. 일반 프로그램이 셸 위에서 실행 중이거나 실행 여부가 불명확하면 시작을 거절합니다. Windows 시작을 제외하던 웹 테스트와 지원표의 시작 불가 항목을 제거했습니다. ## Review - **판단해 주세요**: 모호한 자식 프로세스를 셸 대기로 읽지 않는지, 실행 파일·스크립트 이름을 패키지보다 먼저 대조하는지 봐 주세요. - **조심해서 볼 파일**: `hide-platform/src/windows_process.rs`, `process.rs`의 네이티브 포인터·길이·수명 검사와 단일 자식 wrapper 탐색. - **조심해서 볼 파일**: `hide-holder-protocol`, holder watch, node의 선택 필드 협상이 이전 버전과 함께 작동하는지 봐 주세요. - **정의 소유권**: 감지는 정의의 `packages`만 읽고 전체 이름을 대조합니다. 설치 선언과의 일치, 중복·잘못된 사용자 파일 거절을 검사합니다. - 추가 패키지 근거는 상류 [Kimi 725-732](https://github.com/herdrdev/herdr/blob/2ecf19a/src/detect/mod.rs#L725-L732), [Qwen·Letta 740-754](https://github.com/herdrdev/herdr/blob/2ecf19a/src/detect/mod.rs#L740-L754)입니다. - **비용 검토**: 기존 출력 기반 관찰을 재사용하고 wrapper는 32단계 이내입니다. 새 프로세스의 인수만 최대 64 KiB 읽으며 파일 읽기·별도 프로세스·유휴 타이머는 추가하지 않습니다. - 기존 시스템 프로세스 목록에는 행 수 제한이 없습니다. 실제 CPU·지연은 측정하지 않았습니다. ## Evidence - **확인한 것**: 최종 커밋의 Mac 전체 lint·test 통과, 7,571개 통과·실패 0개·172개 제외입니다. - **확인한 것**: 새 커밋의 Windows OS 계약 284개와 클라이언트 계약 5개 통과, flaky 0개입니다. - **확인한 것**: 실제 holder의 busy 거절과 일곱 종류의 spawn·직접 실행·화면 상태가 Windows 새 엔진 CI에서 통과했습니다. - **작성한 검증**: 실제 Windows npm 실행 경로는 패키지별로 나눴고, 두 패키지 설치·두 시작 경로·기대값·30초 제한을 유지했습니다. - **확인한 것**: 최종 Windows 새 엔진 e2e 71/71 통과·flaky 0, 실제 holder의 busy 거절도 첫 시도에 통과했습니다. - **남은 실패**: Windows 기존 엔진은 84 통과·1 flaky입니다. 공통 fixture의 부모 확인 실패로, 첫 시도와 재시도 근거를 [#513](https://github.com/with-hide/hide-private/issues/513#issuecomment-6628108620)에 남겼습니다. - Herdr 레인 전용 관측이며 b4-default에서 레인과 함께 사라집니다. 이 PR은 #513을 닫지 않습니다. - **CI**: [최종 전체 실행](https://github.com/with-hide/hide/actions/runs/41809370623)에서 43개 job이 통과했고 실패 job은 없습니다. - **확인하지 못한 것**: 실제 설치된 일곱 CLI의 전체 제품 여정과 CPU·지연은 측정하지 않았습니다. - Windows PC의 범위 검사 통과와 전체 통합 221/225 결과는 별도 증거로 남겼으며, CI나 Mac 전체 검사로 합치지 않았습니다. - **생성물**: Windows API 기능에 따른 의존성 생성물을 갱신했고, 생성 명령이 추가 변경 없음으로 끝났습니다. <details><summary>Verification record</summary> - Candidate: `62d19982f026a16fdff9434ecaa16650ce098037`; base `main`, 별도 작업 브랜치. - Required checks: Mac `605421b9c` lint 통과. 첫 test는 holder의 xterm 의존성 누락으로 중단(핵심 4042 통과, holder 73 통과·7 실패). 의존성 설치 뒤 전체 test 재실행은 디스크 부족으로 중단. `df7b1f5d5`의 lint는 통과했으나 test는 후속 수정 요청으로 중단(exit 143)했습니다. 최종 `62d19982f`에서 holder 시험 의존성 설치 후 `lockf -k /tmp/hide-premerge.lock`, `CARGO_BUILD_JOBS=2`로 lint와 test가 exit 0으로 끝났습니다. 7,571 통과·0 실패·172 제외, 65개 결과 묶음. 실행 09:41:26~09:51:45 UTC, 로그 SHA-256 `9f36abb01ecc419c0792a3fb050493b43f7a4828bc638f8e662f98234db6de9a`. - First CI: [41783332804](https://github.com/with-hide/hide/actions/runs/41783332804), `15b618baa`. 형식, 의존성 생성, Windows Clippy, Unix로 한정된 시험 도우미, 새 e2e의 세션 미보고 실패를 보존했습니다. - Windows PC: `15b618baa` 위 수정 패치로 범위 Clippy 통과. 플랫폼 argv의 빈 인수·공백·인용·비ASCII 시험 통과. 정의 8+37, 프로토콜 19, 플랫폼 단위 47 통과, 플랫폼 통합 221/225 통과. - Windows CI: [41786401295](https://github.com/with-hide/hide/actions/runs/41786401295), `605421b9c`. OS 계약 284 통과·5 제외, Windows check와 실제 holder의 busy 거절 계약 통과. own web e2e 56 통과·13 실패. 공통 입력 준비 11건, 셸 구문 1건, 세션 보고 준비 1건을 보완한 현재 커밋은 재검증 대기. - Windows CI follow-up: [41791351359](https://github.com/with-hide/hide/actions/runs/41791351359), `6949b0238`. 새 엔진 68 통과·1 실패(Codex 시험의 kit 상태 조회 경로), 실제 holder의 busy 거절 통과. 기존 엔진 7개 신규 시험 실패(세션 보고 준비), 웹 검사 미사용 import 실패를 수정했습니다. macOS holder restart는 임시 plugin 폴더 정리 ENOTEMPTY 실패. 전체 실행은 후속 push로 취소되어 완료된 job 결과만 증거로 남깁니다. - CI follow-up: [41795308766](https://github.com/with-hide/hide/actions/runs/41795308766), `df7b1f5d5`, FAIL. Windows own 68 통과·1 실패(시험 번들의 ConPTY 누락), Windows Herdr 3개·Linux Herdr 1개 실패(omp 시험의 중복 훅 호출). 그 밖의 실행 job은 통과했습니다. - CI follow-up: [41800640958](https://github.com/with-hide/hide/actions/runs/41800640958), `f9e0a0fb1`, 진행 중 Windows OS 계약 실패. 종료 요청만 한 자손 PID의 즉시 조회가 두 번 모두 실패했으며, 종료를 확인하고 핸들을 유지한 프로세스로 같은 NotFound 계약을 검사하도록 수정했습니다. Windows own web은 69/69, Herdr web은 83/83 통과했고 둘 다 flaky가 없었습니다. 일곱 native 시작·상태 및 두 npm 경로가 모두 통과했습니다. Linux own web 여섯 shard도 통과했으며 macOS desktop 1/2가 남은 시점의 후속 push로 전체 실행은 취소됐으며 완료된 job만 증거로 남깁니다. - CI follow-up: [41803986117](https://github.com/with-hide/hide/actions/runs/41803986117), `08e4ddd23`. Windows own 69/69 통과·flaky 0, OS 계약 284+5 통과. Windows Herdr는 82 통과와 신규 npm ps1 시험 1건의 재시도 통과였으며 처음 30초 실패를 보존했습니다. 두 패키지 설치와 모든 기대값은 유지한 채 패키지별 시험으로 나눴습니다. 전체 실행은 다음 push로 취소되어 완료된 job만 증거로 남깁니다. - Final CI: [41809370623](https://github.com/with-hide/hide/actions/runs/41809370623), `62d19982f`, 전체 PASS(43개 job 통과, 실패 0). Windows OS 계약 [job 126505347650](https://github.com/with-hide/hide/actions/runs/41809370623/job/126505347650)은 284+5 통과, flaky 0. Windows own [job 126505349253](https://github.com/with-hide/hide/actions/runs/41809370623/job/126505349253)은 71/71 통과·flaky 0, skip 제거 17개 spec 모두 실행 통과입니다. Windows check [job 126505347253](https://github.com/with-hide/hide/actions/runs/41809370623/job/126505347253)의 실제 holder busy 거절은 첫 시도 PASS입니다. Windows Herdr [job 126505349826](https://github.com/with-hide/hide/actions/runs/41809370623/job/126505349826)은 84 통과·1 flaky, npm ps1 pi의 시작 전 공통 fixture에서 `agent_pane_required` 첫 실패(2.4초), 재시도 PASS(14.7초)입니다. 최초 #513의 시간 초과와 구분하고 추가 수정을 멈춘 운영 결정을 따릅니다. Linux own 여섯 shard는 391 통과·flaky 0. Linux Herdr 여섯 shard는 447 통과·flaky 0, macOS desktop 두 shard는 125 통과·flaky 0입니다. - Windows PC follow-up: `08e4ddd23`의 수정한 프로세스 종료 계약 두 시험 통과. 첫 시도 LNK1104를 보존했고 같은 SHA 재실행에서 통과했으며 전체 검사 대체가 아닙니다. - Windows PC exact head: `605421b9c` core all-targets check와 own engine 감지 시험 11개 통과. SSH 환경의 전체 통합 실패와 별도 증거입니다. - Mac protocol: 후보 패치의 수기 wire 기대값 오류 첫 실패를 보존했고, u16 길이로 바로잡은 뒤 19/19 통과. - Review: [605421b 소스 리뷰 통과](#2068 (review)). [df7b1f5 후속 리뷰](https://github.com/with-hide/hide/pull/2068#pullrequestreview-5765446368)는 재시작 전 준비 표시 잔존으로 보통 1건 FAIL. [f9e0a0f 후속 리뷰 통과](#2068 (review)): 이전 표시를 지우고 실제 Reopen을 준비 직전에 붙잡는 검증으로 지적을 닫았습니다. [08e4ddd 종료 관찰 시험 소스 리뷰 통과](#2068 (comment)), 실행 성공 증거와 구분합니다. - Final delta review: [62d1998 시험 분리 소스 리뷰 통과](#2068 (review)), 새 지적 0. - 운영자의 앱·pane·설치를 변경하지 않았습니다. Windows PC 작업은 승인된 격리 폴더 안에서만 수행했습니다. </details>
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: #301 (Agent 영역 Ctrl+Tab), #306
Summary
Agent 영역 Ctrl+Tab(⌃Tab, 브라우저 ⌥
)이 걷는 "최근 agent pane" 순서는 웹 메모리에만 있어서, 새로고침, 앱 종료, hided 재시작 때마다 비었습니다. 이제 방문을 판단하는 규칙은 그대로 페이지가 갖고, 방문마다pane_visit이벤트로 core에 알립니다. core는 순서를ui_state.recent_pane_ids(최신순, 최대 50)로 들고core-state.json`에 UI 상태와 함께 저장합니다.Agent 사이클은 이 순서를 스냅샷에서 읽습니다.
Review
herdr-core/src/runtime/recent_panes.rs- ownership. 방문 판정은 페이지, 순서와 저장은 core가 맡습니다. 목록에 없는 pane은 진단 로그로만 거절합니다.web/src/recent.ts- failure path.reported와 스냅샷 head 비교로 중복 전송을 막습니다. 에코 전에 A→B→A로 돌아오거나, 다른 창이 head를 바꾸면 다시 보냅니다.herdr-core/src/runtime/events.rs- snapshot wire.ui_state_update에코는 이 목록을 보내도 무시하고 core 값을 유지합니다.Evidence
web/e2e/recent-agents-restart.spec.ts(격리된 pinned Herdr 0.9.1과 hided 사용). beta의 Codex를 방문한 뒤 fixture로 돌아와 hided를 재시작하고 새로고침했습니다. 사이드바에서 연 사이클에 두 행이 남아 있었고, beta 행을 커밋하면 beta 탭이 앞으로 옵니다.web/e2e/recent.spec.ts가 그대로 통과합니다(방문 규칙, Explorer/Overview, View 범위).ui_state_update에코 뒤에도 순서가 유지되는지 검사하는데, 에코가 core 값을 유지하는 부분을 빼면 이 테스트가 실패합니다.recent_checkouts의 공유 저장 테스트를 고쳤습니다. 기존 테스트는 페이로드 디코딩에 실패해서 아무것도 증명하지 못하고 있었습니다.verify-cargo.sh lint통과, herdr-core lib 1421/1421, web 단위 1032/1032, web typecheck/lint 통과(e2e 크기 예산 포함).