Repository navigation
Hold the letter bell while a Codex CLI plan waits for approval - #752
Merged
Merged
Conversation
The session read folds Codex CLI's turn records (task_started with its mode, the Plan item, task_complete, turn_aborted, a person's message) into an agent-neutral turn tracker that answers whether the last turn waits for the operator to approve a plan. The tracker rides on the label transcript request and answer, so an incremental read, a restart from the anchor and a device helper carry it; an answer without it reads as not known.
The label worker stores the session read's turn tracker beside its checkpoint and the Herdr state_change_seq the read was asked under, so the overlay only answers what an agent waits for when that read is for the agent's current state and session. A restart resumes without a read when the wait was read for the same state; a record without a tracker is read once. Rows carry the wait as awaiting_operator in their facts.
Codex CLI's plan approval menu reads done to Herdr, and the bell's Enter picks "Yes, implement this plan". The delivery observation now carries what the pane's session read says for Herdr's current state, taken from the label overlay, which the coordinator computes before delivery observes the payload. The bell holds with awaiting_operator while a plan waits, and with session_unread when an agent whose read reports turns was not read for the current state and session. Agents whose read reports no turns are belled as before.
A Codex CLI plan that waits for the operator's approval reads done to Herdr. When the session read says so for the agent's current state, the row's demand is approval and it is held in Needs You like a prompt Herdr reports blocked, so reading the row does not drop it. The Enter that approves such a plan stays the operator's submit, since Codex CLI writes the next turn's message from it.
Herdr can report working before Codex CLI writes the new turn's start, so the read for that state still finds the finished plan. A running agent waits on no one, so the row ignores the wait until Herdr's state rests.
The spec starts the fixture shim as `codex` on an isolated pinned Herdr and hided, writes a Codex CLI 0.160.1 rollout whose plan-mode turn proposed a plan, and moves Herdr's state: the row reaches Needs You with the approval mark, and the next turn's record takes it out.
delivery.md no longer calls Herdr's blocked the only menu guard and explains the awaiting_operator and session_unread holds, status-model.md and UI_BEHAVIOR.md draw the wait as an approval held in Needs You, ARCHITECTURE.md places the turn tracker in the label read, and the performance ledger records that the read adds no work of its own.
… the test process
… reads the menu as
…reader does not know
…he row in Needs You
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: PRD
agents/prd/codex-plan-approval-hold/prd.md(local). The reviewable contract is below.Summary
task_started의 plan 모드, Plan 항목,task_complete)으로 계획 승인 대기를 알아내고, 그동안 종을 보류 사유awaiting_operator로 치지 않습니다.state_change_seq에 묶여 지금 상태에 대해 읽지 못한 Codex pane은session_unread로 종을 보류합니다. Claude Code pane은 그대로입니다.docs/delivery.md,status-model.md,UI_BEHAVIOR.md,ARCHITECTURE.md, 성능 ledger.Review
task_complete기록보다 먼저 정지 상태를 읽으면, 그 상태에서는 종만 보류되고 Needs You는 다음 상태 변화까지 뜨지 않습니다. 재읽기를 더하지 않았습니다(PRD B10).herdr-core/src/delivery/doorbell.rsjudge- failure path. 모름을 "대기 없음"으로 읽지 않습니다.herdr-core/src/labels/overlay.rswaiting,labels/{worker,store}.rs- seq 묶음과 serde 기본값으로 저장되는 새 필드.herdr-core/src/session_sync/coordinator.rs- runtime mutex. overlay를 lock 밖에서 먼저 만들고 두 경로 모두observe_delivery에 넘깁니다(main #743과 merge 해결 지점).hide-session/src/turns.rs- 대기를 언제 안다고 볼지 정하는 match.Evidence
cargo test --workspace, S2 lint PASS(merge head 267aad3). 첫 두 시도는 base에서도 실패하던 pane process 테스트 때문이었고, main의 Draw pane topology changes before Herdr confirms them #743 수정으로 대체됐습니다.hide-session계약 테스트가 합성 Codex 0.160.1 계획 턴 표본으로 대기 시작, 다음 턴, 사람 메시지, aborted 턴, 질문으로 끝난 plan 턴, 모르는 형식, 증분 읽기와 rescan을 확인합니다.codex-plan-approval.spec.ts가 고정 Herdr와 hided 위에서 계획 대기 rollout이 행을 Needs You로 넣고, 다음 턴 기록과 상태 변화가 빼는 것을 확인합니다. 심은 결함에서 실패하는 것도 확인했습니다.idle로 읽는 동안 편지가awaiting_operator로 한 번 기록되고 보류됐으며, 키 입력 0회, 메뉴 그대로였습니다. 승인 뒤 다음 턴이 끝나자 종이 한 번 울렸습니다.idle로, 번들 2026.09.23.1에서는unknown으로 읽습니다(문서에 manifest별로 적음).~/.codex/sessions에 Codex rollout 3개를 남겼습니다(설정 변경 없음).AI tooling: native review subagents read the diff; their findings and dispositions are in the record below.
Verification record
agents/prd/codex-plan-approval-hold/prd.md(sha256 e67aa258a404f1a493a93eec74933e5324e0fcbccbbf40ab605b23e78d819012)agents/runs/codex-plan-approval-hold/verification-report.jsonandagents/runs/codex-plan-approval-hold/verification-report.md; source fingerprint f5b5d1bca59a1702fd81feceebf3c2c3946c71d2f7d3503bac7eb4d8b6b4cf14bash scripts/verify-cargo.sh test(exit 0)bash scripts/verify-cargo.sh lint(exit 0)unknown(1bd5647), e2e negative check proved nothing (c6c9e75); fixed. A re-read of unsettled turns (8ad7ab8) was reverted (9c0f057) under PRD B10.