Repository navigation
자는 child의 registration을 깨운 pane이 이어받게 한다 - #922
Merged
Merged
Conversation
A session that sleeps by closing its pane saves the delivery registration it held. While it sleeps, the closed pane ends neither the registration nor the watches on it. The wake starts the agent under the registered name, and once the new pane runs the same conversation the delivery store moves the registration, its letters, its watch and its spawn receipt to that pane, so lineage tokens, the sidebar place and letter delivery return with it.
yansfil
added a commit
that referenced
this pull request
Oct 10, 2026
Closes #916 ## Summary 배포된 앱의 web pane 메뉴에는 Fork를 시작할 곳이 없었습니다. core는 `fork_pane` event와 pane별 `fork` 사실을 이미 갖고 있었습니다. 이제 에이전트 pane의 메뉴에서 Sleep agent 바로 아래에 Fork agent가 나오고, 누르면 `fork_pane` 하나를 보냅니다. 대화를 아직 보고하지 않은 에이전트는 core가 준 이유와 함께 꺼진 항목으로 보입니다. fork로 만들어진 pane은 제목 뒤에 fork 아이콘이 붙고, 툴팁과 접근성 이름이 `Forked from <원본 이름>`입니다.   ## Review - **판단해 주세요**: fork 여부를 이름 모양이 아니라 core의 상태로 정했습니다. Fork가 만든 registration에 `forked` 사실을 두고(`AgentRecord::forked`), lineage writer가 그 registration이 있는 pane에 `fork` pane token(`1`)을 다른 lineage token과 함께 씁니다. 읽는 쪽은 그 pane이 아직 부모를 선언하는 동안만 읽습니다. 자는 child를 깨운 pane이 registration을 이어받을 때(#922) 표시도 같이 옮겨 갑니다. 이름으로 추정하면 깨운(wake) pane이나 위임된 child가 fork로 보입니다. 이전 `forked_from_pane_id`는 어떤 child든 부모를 가리켜 위임 child도 fork로 읽혔습니다. - **판단해 주세요**: fork 표시는 운영자가 고른 A안입니다: 헤더 제목 옆의 작은 fork 아이콘, 툴팁과 접근성 이름은 `Forked from <원본 이름>`. 새 pane은 위임 child와 같이 원본의 하위로 자기 pane을 갖습니다(스크린샷의 사이드바). - **판단해 주세요**: 대화를 보고하지 않은 에이전트의 꺼진 항목은 core의 이유 문구를 그대로 보여 줍니다. 셸이나 fork 명령이 없는 에이전트에는 항목이 없습니다. - **조심해서 볼 파일**: `herdr-core/src/coordination/lineage.rs` (`desired`) - `fork`가 live lineage일 때만 `1`이고 아니면 null로 지워지는지, 깨운 pane에도 쓰이는지. - **조심해서 볼 파일**: `herdr-core/src/sidebar.rs`, `herdr-core/src/runtime.rs` - `started_as_fork`와 `forked_from_pane_id`가 token과 선언된 부모 둘 다 있을 때만 서는지. - **비용 검토**: 새 상시 작업, 타이머, 알림 fan-out 없음. 항목은 클릭 한 번에 event 하나이고, fork 사실은 이미 있던 snapshot 행에 값 둘이 더해질 뿐입니다. ## Evidence - **확인한 것**: - web e2e `web/e2e/agent-fork.spec.ts`: 격리된 Herdr와 hided에서 Fork agent 항목이 켜지고, 누르면 `fork_pane`이 원본 pane id로 나가고, 새 pane이 `claude --resume <세션> --fork-session`으로 뜨고, 그 pane에만 fork 아이콘이 붙는 것까지 봅니다. 인접 spec(`agent-sleep`, `session-readers`, `s6`, `lineage-session`)도 같은 실행에서 통과했습니다. - 단위 테스트: 메뉴 항목(켜짐, 꺼짐과 이유, 항목 없음) `web/src/paneMenu.test.ts`, token 쓰기와 깨운 pane에서의 이어받기 `lineage.rs`, 위임 child가 fork로 읽히지 않는 것과 이유 문구 `fork.rs`. - `bash scripts/verify-cargo.sh test`와 `bash scripts/verify-web.sh` 통과, `node scripts/check-design-contract.mjs` 통과. - **확인하지 못한 것**: Pen 화면 렌더와 `design-review`(비교할 baseline bundle이 없어 돌리지 못했습니다), 실제 설치 앱 캡처, desktop e2e는 돌리지 않았습니다. fork된 pane이 한 번 뜬 뒤 hided를 재시작해도 fork 표시가 남는지는 확인하지 않았습니다(token은 Herdr가 보관합니다). - **생성물**: `design/hide-screens.pen`은 `scripts/gen-screens.mjs`로 다시 만든 결과입니다. 세션 화면의 "Forked pane" 섹션이 더해졌습니다.
This was referenced Oct 10, 2026
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.
Closes #913
Summary
패널을 닫는 방식으로 재우는 위임 child(OpenCode, Pi, omp, Grok, Cursor)는 깨우면 새 pane에서 같은 대화로 돌아오지만, registration은 닫힌 옛 pane에서 끝나고 새 pane에는 lineage token이 없었습니다.
그래서 이름이
fork-sleep-...으로 바뀌고, 사이드바에서 부모 아래를 떠나며, 편지가target_unavailable로 실패했습니다.이제 재울 때 core가 그 pane의 registration을 sleep 기록에 저장하고, 깨운 pane이 같은 registration(id, 이름, 부모, watch, 편지 주소)을 이어받습니다.
어느 pane이 어느 registration을 잇는지는 core가 시작한 wake가 이미 알고 있으므로 이름이나 session으로 다시 짐작해 묶지 않습니다.
Review
Pending으로 기다립니다. 1시간 안에 깨우지 않으면 기존 규칙대로Undelivered가 됩니다. 이 기한을 자는 세션에는 늘릴지.agent_sleep.registration_refused에 사유와 함께 남습니다.herdr-core/src/runtime/agent_sleep/dormant.rs- 이어받기 판정(continue_dormant_registration)이 runtime mutex 안에서 도는데 I/O 없이 ledger 스냅샷과 관측만 읽습니다.herdr-core/src/delivery/worker.rs,coordination/mod.rs-rebind가end_gone보다 먼저, 같은 트랜잭션에서 registration, 편지, watch, spawn 영수증을 옮깁니다.herdr-core/src/runtime/delivery.rs- 자는 동안 registration과 watch가 "pane 없음"으로 끝나지 않게 막는 두 자리(observe_registration_panes,delivery_watch_work).observe_delivery마다 sleep 기록(최대 256개)을 한 번 훑고, pane 집합이 바뀔 때만 registration id 집합을 모읍니다. lineage writer의 변경 감지는 길이만 보던 것을 registration의 (id, pane) 해시(최대 2048개, 약 1초마다)로 넓혔습니다.herdr agent prompt를agent_not_ready로 거절하는 현상은 여기서 재현하지 못했습니다(아래).Evidence
a_sleeping_childs_registration_letters_and_watch_pass_to_the_pane_that_wakes_it- 실제 delivery worker와 디스크 ledger로, 자는 동안 registration, watch, 대기 중인 편지가 유지되고 깨운 pane으로 모두 옮겨지며 옛 pane 주소는 사라지는 것을 봅니다.a_woken_pane_of_another_conversation_inherits_nothing_and_the_registration_ends). 판정 조건 하나를 지우면 이 테스트가 실패하는 것도 확인했습니다.gone)와 lineage 변경 감지를 각각 지워 보면 해당 테스트가 실패합니다.agent_name_taken을 두 번 받은 뒤 시작), 등록이 없으면 예전처럼 fork 이름이며 거절이 그대로 답입니다.verify-cargo.sh lint,fmt-check,nextest --workspace3916개 통과,check-capability-readers-off-lock,check-core-touches-no-machine,check-no-workstation-identity,check-no-attribution./Applications/hide.app과 Herdr server는 건드리지 않았습니다.agent_not_ready. 격리 Herdr를 띄워 새로 시작한 Pi와 깨운 Pi를 비교하려 했으나,herdr agent start직접 호출이 Hide의 위임 기록 hook에 막혀 돌리지 못했습니다. 코드로는 wake와hide agent spawn이 같은agent.start를 쓰고 Hide는agent prompt를 호출하지 않으므로, 원인은 Herdr의 자체 readiness 판정일 가능성이 높습니다. Herdr 이슈는 올리지 않았습니다.