Repository navigation
feat: put a finished mission's agents to sleep and wake sleeping agents for letters - #1866
Merged
Merged
Conversation
…ts for letters A letter to a registered agent Hide put to sleep is now taken instead of refused: a request or block wakes the agent with its conversation resumed (at most four letter wakes at once, in arrival order, without moving the operator's screen), a report or progress waits for its next wake, and the delivery deadline does not run while it sleeps. A failed wake leaves the letters that waited on it undelivered and tells their senders why. When a mission node finishes (done, failed, dropped, its pull request merged or closed, or its mission closed), its worker and bound checkers are put to sleep once they rest off screen; a refused end is tried again the next minute, and a woken worker is not slept again for the same finish. hide agent sleep <id> [--actor <id>] puts an agent to sleep for itself or its parent, answering ending or asleep, or a refusal code with its next action.
…ng its letters A dormant wake refused for a passing reason (a busy checkout, no free transition, a close not yet confirmed) and an in-pane wake with no connection now stay queued; an agent whose wake failed no longer pauses its letters' delivery hour; a mission mark is spent when a pane-closing sleep landed and its registration moved on; and a mark is kept while its node machine does not answer. hide agent sleep's contract lists agent_pane_required.
…y the pipes closing, not the shell's pid Under a loaded full workspace run the fake gh's shell sometimes did not reach its first line before the 3 s deadline, so the pid file the test unwrapped was missing (with-hide/hide-private#366). run_gh answers only once both pipes reach end of file, and gh and every helper hold them until they end, so an answer before the helper's minute proves the whole tree was killed; the pid, when the shell wrote it, still has to be dead.
A request that rang or that already woke its recipient kept the sleeper's route waiting, so an agent that slept again by the hours, its mission or hide agent sleep was woken by the same pending letter each time. Each letter now wakes its recipient once and a letter whose bell rang wakes no one; the set is memory beside the wake queue. The docs also say a failed sleeper's hour runs again and a wake that cannot start leaves a new request to expire without a note.
…l Herdr After the wake one bell rings for the worker's turn, led by the oldest pending letter and counting the request with it. The fixture conversation is written now so turning sleep on does not find it hours idle, the mission sleep is asserted by its trigger, a pending request does not wake the worker after its mission sleep, waits are quietFor windows and debug output moved into failure messages.
…ter sleep Once a letter wakes its recipient at most once, a letter that rang or whose wake started before the current sleep wakes no one, so pausing its deadline for that sleep left its sender waiting until something else woke the agent. Only a letter waiting for its recipient's wake now pauses its hour (Sleeper::pausing); the letters that woke someone are kept with when, and a wake that ends during its own start marks its letters too.
…ding in the mission sleep spec
… sleeps Only a request or block wakes its recipient, so only those stop pausing their hour once they rang or woke it; a report or progress waits for the next wake, rung or not (PRD B3).
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 with-hide/hide-private#366
Related: PRD
agents/prd/mission-worker-sleep/prd.mdSummary
request,block편지는 에이전트를 깨우고,report,progress편지는 깰 때까지 기다립니다.request/block은 다음 잠에서 다시 깨우지 않고, 그 잠 동안 기한이 흐릅니다. 그래서 아무도 읽지 않는 편지가 재우기와 깨우기를 되풀이시키지 않습니다.hide agent sleep <id> [--actor <id>]: 에이전트 자신이나 부모가 재울 수 있고, 안 되면 이유와 다음 행동을 돌려줍니다.Review
bell_sent는 false로 남습니다. 기존 벨 설계 그대로입니다.herdr-core/src/runtime/agent_sleep/letters.rs- runtime mutex 안의 깨우기 큐, 한 번만 깨우기, 실패 경로, 안내 편지 스레드의 drop guard.herdr-core/src/delivery/ledger.rs,worker.rs- 저장소 스레드가 매 패스 읽는 잠든 수신자와 기한 멈춤 규칙(Sleeper::pausing), 깬 뒤 기한 재계산(resume_woken).herdr-core/src/runtime/agent_sleep/missions.rs- 끝이 실제로 내려앉을 때만 표시를 쓰는 규칙, 거절되면 다음 분에 재시도.test: prove timed_out_gh_and_its_pipe_holding_helper_are_terminated ...- 셸의 pid 대신, 파이프가 닫힌 것으로 gh와 도우미 종료를 증명합니다.Evidence
web/e2e/mission-worker-sleep.spec.ts가 고정 버전 Herdr와 격리된 hided, Claude 대역(fixture shim)에서 최종 빌드 기준 7번 통과(약 2.6분씩). 한 번의 실패는 스펙의 세션 읽기 경합이었고 poll로 고쳤습니다.hide agent sleep-> ending, 다시 물으면 asleep. 잠든 일꾼에게 report는 pending으로 받아지고 아무도 깨우지 않음. request가 resume으로 깨워 같은 세션으로 복귀. 운영자 pane의 포커스와 Herdr 포커스 유지.herdr-corelib 테스트 3501개 통과. 이후 집중 실행: mission_worker_sleep, delivery::ledger, delivery::worker 49개,hidedguide·cli 93개, clippy-D warnings.a_request_wakes_its_recipient_once_and_a_rung_one_not_at_all은 고치기 전 코드에서 실패하는 것을 확인했습니다. 기한 규칙의 ledger 테스트는 새 함수에 대한 것이라 고치기 전에는 컴파일되지 않습니다.verify-cargo.sh test전체)은 운영자 승인으로 뺐습니다. 부하 15~30에서 이 브랜치 밖의 시간 제한 테스트만 실패했습니다: with-hide/hide-private#332, withhide.dev에 Hide 소개 사이트 구축 #338, Verify native Windows listener attribution and cleanup #368. 전체 테스트는 PR CI가 맡습니다.Verification record
agents/prd/mission-worker-sleep/prd.md(sha256 f1bdebeb7591b90674dc3e7894f0ce76b0bfefe836577c415473403a1e09cd81)agents/runs/mission-worker-sleep/verification-report.jsonandagents/runs/mission-worker-sleep/verification-report.md; source fingerprint 430b6550a3424e9d73cb409cb3b68d651fe29dd6f9488fd5286baf6d75f12c3ebash scripts/verify-cargo.sh testbash scripts/verify-cargo.sh lint(exit 0)gen-prd/mission-worker-sleep, basemain