Repository navigation
fix: confirm typed input by the core's projected turn, not Herdr's raw status - #1967
Merged
Merged
Conversation
…w status The typed-input confirmation, the composer read before a retype and omp's turn record read Observation::projected_turn, the turn the row and the doorbell read; the composer read shares the doorbell's input gate (doorbell::unheld_turn, doorbell::takes_keys). A turn not laid yet keeps the last verdict for UNSETTLED_HOLD_MS at most.
…tled, with no timer Drop the 5 s cap: a stale read or an unlaid pass keeps the verdict the doorbell's last pass reached for that typing (plans.input_verdicts), which the row's ask and hide agent show both read; the next agent list or the pane leaving ends it.
… typing A pass that sees the core's turn working since after the typing, with no input routed to the pane and no letter bell typed there since, remembers that typing as taken (plans.input_turn_started); an empty composer then holds with turn_started, while the parent's notice and the Enter for a brief still in the composer stay.
…omp's A latched turn-started brief is recorded with by: turn, so its parent is not told, its row asks nothing and agent show lists nothing; only a turn the agent's own hook reports latches (TurnProjection::reported), never Herdr's reading alone. The separate retype hold is gone.
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.
Summary
Hide checks a brief or letter it typed against the agent's own record. If the agent never records it, Hide tells the parent and types it again once someone answers the screen.
That check decided "the agent is working" from Herdr's raw status. The row, the doorbell and sleep all read the core's one turn instead (hook first, then session file, then Herdr, #1954).
When the two disagreed, the typed-input decision disagreed with the row:
Now the confirmation, the composer read before a retype, and omp's "a turn after the typing is its record" all read the same projected turn.
The composer read goes through the same gate a bell is typed through, now shared with the doorbell (
doorbell::unheld_turn,doorbell::takes_keys).One more rule for the same decision: a brief also counts as taken when the agent's own hook reports a turn that started after the typing, and no other input or bell could have started it.
It is confirmed
by: turn, as omp's already is: the parent is not told, the row asks nothing, and it is never typed again, even if the prompt digest never matches.Today a long brief to Claude Code reads unconfirmed though it was taken (its digest is being fixed separately), and nothing may type a brief twice (principle 11).
Review
hide agent showkeep the last verdict for that typing (plans.input_verdicts).A state ends this, never a timer: the next agent list (asked every second) lays a fresh turn; a stale read ends with the list that confirms the agents again, and until then the row also shows activity unknown; a pane Herdr no longer lists drops its input.
Without this, the doorbell's 250 ms pass falls into that moment on every session pass. It would drop the asked reread (so the verdict starts over) and make the row's ask blink.
A stale read used to drop the row's ask; it now keeps it.
Hide still does not retype or read the composer while Herdr reads them working (
takes_keys, the same rule the bell follows).TurnProjection::reported), never Herdr's reading alone. It misses a turn shorter than one pass, input during the turn, a core restart (the latch is memory until the store confirms), and agents whose hook reports no turn. Those keep the record-only rule.herdr-core/src/delivery/doorbell.rs:judgeis split into two helpers with the same holds in the same order; the bell's behavior must not change.herdr-core/src/delivery/typed.rs:composer_readableis now the doorbell's gate, so for a kind without tool letters, a turn at rest that Herdr still reads asworkinggets its composer read. The off-lockreadiness.accepts_input()check still holds before any key is sent.plans.input_verdicts, one entry per unconfirmed input (bounded by open inputs), under the lock it already holds, with no I/O.delivery/watch.rsreads Herdr status changes as an inactivity clock for quiet-child warnings, andworker.rssame_targetcompares samples. Neither decides whether the agent works now, so neither is changed.Evidence
typed_input_worknotice and retype,input_asksrow). Both fail against the old raw-status read and pass now.a_stale_read_keeps_the_briefs_verdict_until_a_fresh_turn_is_laiddrivestelemetry_stalethrough Unsettled and back: across a 10-minute stale read the row's ask andagent show'sunconfirmedstay, nothing is sent, and the reread is not asked again. A fresh turn continues the verdict, an unlaid pass holds it the same way, and the pane leaving drops it. It fails when a stale read falls back to Waiting, as before this PR.a_brief_whose_hook_reports_a_turn_after_the_typing_is_confirmed_by_that_turn: during the turn and after it ends (record still unmatched, screen answered), the doorbell gets onlyrecorded: turn, with no notice, reread or resubmit; the row has no ask andagent showlists no pending brief.a_turn_herdr_alone_reads_or_other_input_started_is_no_record_of_the_brief: Herdr-only working, a key after the typing, and a letter bell after the typing each still end in the parent's notice.herdr-corenextest, clippy-p herdr-core --all-targets,cargo fmt,check-engine-boundary.py,check-core-touches-no-machine.py,check-capability-readers-off-lock.sh.Verification record