Repository navigation
Measure agent status on current main, and fix what the runs found - #3302
Merged
Merged
Conversation
The responsiveness note's latency readings dated from headless Claude Code runs on 2026-10-05. Two journeys per harness on current main, the in-tab latency bench and the status evaluations replace them. Titles land in 1.2-2.7 s on Claude Code and Pi and 3.1-5.7 s on Codex App Server, against a 2 s target. Replies to a small page change take 21-42 s on every harness, against 7 s; Leaf's own delivery and tool time is 0.3-2.6 s of that, and the rest is five to ten model calls. Every status evaluation passed, 28 of 28 samples (listed in the note). The runs found three defects, each fixed here: - A command given no text read stdin. Claude Code hands a command whose text spans lines a socket as its stdin, which never closes, so a reply with a multi-line `--markup` and no `--text` hung until the Bash tool's 120 s timeout. It did so in both hooks-module journeys run earlier tonight, where the `ending` step took 140-168 s. `piped_input` now reads stdin only from a pipe or a file, for every body (`read_text_arg`) and for `data set` and `task plan` without `--file`, and the sandbox's bridge relays stdin by the same rule, since the command it starts reads a pipe of its own. Such a command is refused at once: a body with "empty text", JSON with a new "no JSON given". Tests hold a socket as stdin directly and through the bridge. - The claude-code journey's Escape pressed again whenever it did not see Claude Code idle within 5 s. With the hooks module, the nudge after an Escape can open a turn within a second, so the next press interrupted that turn, and the `woken` step failed waiting for its answer. It now stops once the page's claim has closed the turn or opened another. - `document/idle` and `document/mid-turn` posted their comments under the retry key `delivery-eval-1`, one character shorter than the log admits, so every sample errored before the agent saw a comment. For the TODO item's two open checks: `parent-keeps-leaf-responsive` now also grades whether the page shows delegated work while the workers run, and `website_eval` records each hosted turn's time to its first words, to text showing in the reply and to its answer, from the adapter's own records. The new rubric passed 5/5 across both harnesses, so it guards rather than separates. What remains needs decisions, now two TODO items: after the coordinator's turn ends, the panel's status stops reading Working while its workers run, though Claude Code's record says `busy`; and what the 7 s reply target counts. The note also proposes reading stdin only when asked (`--text -`), which needs no guess from the descriptor but changes the shipped instructions. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 20, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
bridge.run.feed() now sends EOF for every socket stdin, including a caller that explicitly passes --file - to leaf data set or leaf task plan. Click then reads the bridge's empty pipe and reports no JSON given even when the socket supplied complete JSON and closed. That breaks an explicit stdin route while fixing the implicit-read hang. Preserve explicitly requested stdin through the bridge, while letting commands with no stdin option refuse a never-ending harness socket.
… reads a socket The bridge's client stopped relaying a stdin that was not a pipe or a file, so a caller that named stdin itself (`--file -`) from a socket, as a Node caller's piped stdin is, got an empty pipe. The client now relays stdin as before and passes its reading of the caller's descriptor as LEAF_STDIN_PIPED, which `piped_stdin` reads in place of the bridge's own pipe. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 20, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
… after it (#3313) On the corpus example, a saved revision took 0.89–2.09 s to paint against the 1 s target that #3302 measured. Most of that time was server work, and much of it was either repeated or done for a caller that never reads the result. This change cuts it, and it removes a browser long task that made the slow case more frequent. `bench-latency --page corpus --transition revision` ran fifteen paired runs over three invocations at load 4–7 on 18 cores. The revision reaches the tab by one of two routes: | Route | Base | Head | | --- | --- | --- | | Save (the tab's freshness read finds the save first) | 0.89–1.11 s | 0.64–0.79 s | | Stamp (`leaf page stamp` takes the page lock first) | 1.77–2.09 s | 1.11–1.22 s | The triage board's revision paints in a median 153 ms against the base's 139 (range 128–253 and 128–252), within noise. Of the 190 `stills` states, 188 are unchanged; the other two differ only in the layer fingerprint and the share token on the "About this page" view. **Server.** `check_source` walked the page's containment once per live sample; `passages.enclosing_ids` now walks each document once. Anchor relocation walked both revisions in full on every activation and twice per stamp; `SourceReading.decided_passages` now also takes rewritten bodies and created children, so relocation reads the passages each reading already holds, and only when an open thread needs them. Every check judged the page's recorded data to produce advice that only `page check` prints, which cost a cold stamp about 200 ms; `validation.source.source_advice` now produces that advice for `page check` alone. Document delivery spliced each of thousands of marks into a fresh copy of the page; `revision_delivery._spliced` now joins the pieces in one pass, cutting it from 127 ms to 58 ms on the corpus with byte-identical output on 129 local pages. **Browser.** The user-view report's arrangement and label readings asked about boxes in hidden tabs. Each question forced the browser to style and lay out that tab, about 280 ms of work landing 300 ms after each presentation. The view reading now leaves out skipped content (`arrangedBoxes(open, { shown: true })`), and a label is checked for visibility before its box is read. The render gate's own sweep is unchanged. The user-view checks test now includes a closed disclosure, and it fails on the base. `bench-latency` now writes each request's start and end to `results.json`, so a run's time splits into server and page. The stamp route stays over 1 s. `notes/user-feedback-responsiveness.md` ("A corpus revision's paint") proposes two fixes for a decision. One records with each revision the Leaf that checked it, so another process can skip checking an unchanged source again. The other has a stamp check before it takes the lock. A shortcut that compared only the revision's input digest was tried and removed: it covers neither the Leaf that did the checking nor the data contracts a sample reads. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Refreshes the agent-status evidence in
notes/user-feedback-responsiveness.mdfrom current main, runs the status evaluations, and fixes three defects the runs found. The TODO item "Keep agent activity intelligible throughout a task" becomes two items that each need a decision.Readings
Two
leaf-dev journeyruns per harness (Claude Code with and without the hooks module, Codex App Server, Pi), one website-adapter journey, andleaf-dev bench-latency --tree --runs 3replace the 2026-10-05 headless readings. Against the note's targets:Every status evaluation passed, 28 of 28 samples:
plan-shows-multi-step-work,plan-skips-quick-work,parent-keeps-leaf-responsiveand its variants,document/idle,document/mid-turn, andwebsite-replies, on Claude Code and Codex where the case runs there.Fixes
leaf response reply REF --markup '<multi-line>'with no--texthung until the Bash tool's 120 s timeout. It did in both hooks-module journeys run earlier tonight. The newpiped_input.pyreads stdin only from a pipe or a file;read_text_arg,data setandtask planuse it, and the sandbox bridge passes the caller's reading to the command it runs, so--file -still reads a socket. Tests hold a socket as stdin, directly and through the bridge.document/idleanddocument/mid-turnerrored every sample. Their retry keydelivery-eval-1is one character shorter than the log admits.Evals
parent-keeps-leaf-responsivegains adelegated-work-visiblerubric (5/5, a guard), andwebsite_evalrecords each hosted turn's time to its first words, to text showing in the reply, and to its answer.Left for decision
busy.leaf response replyshould report whatleaf page checkdoes to save a model call.--text -), which needs no guess from the descriptor but changes the shipped instructions.