Skip to content

Measure agent status on current main, and fix what the runs found - #3302

Merged
max-sixty merged 2 commits into
mainfrom
agent-a96d215a9a6ece578
Oct 20, 2026
Merged

max-sixty merged 2 commits into
mainfrom
agent-a96d215a9a6ece578

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Refreshes the agent-status evidence in notes/user-feedback-responsiveness.md from 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 journey runs per harness (Claude Code with and without the hooks module, Codex App Server, Pi), one website-adapter journey, and leaf-dev bench-latency --tree --runs 3 replace the 2026-10-05 headless readings. Against the note's targets:

  • Pickup in an idle session: 0.1–0.8 s (target 1 s), met on every harness.
  • Thread title: Claude Code 1.2–2.7 s, Pi 2.0–2.7 s, Codex App Server 3.1–5.7 s (target 2 s).
  • Reply to a small page change: 21–42 s on every harness (target 7 s). Leaf's own delivery and tool time is 0.3–2.6 s of it; the rest is five to ten model calls.
  • Paint after a gesture or write: within budget on the triage board; the corpus misses on comment (median 105 ms) and revision (1.06–1.89 s).

Every status evaluation passed, 28 of 28 samples: plan-shows-multi-step-work, plan-skips-quick-work, parent-keeps-leaf-responsive and its variants, document/idle, document/mid-turn, and website-replies, on Claude Code and Codex where the case runs there.

Fixes

  • 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 leaf response reply REF --markup '<multi-line>' with no --text hung until the Bash tool's 120 s timeout. It did in both hooks-module journeys run earlier tonight. The new piped_input.py reads stdin only from a pipe or a file; read_text_arg, data set and task plan use 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.
  • The claude-code journey's Escape interrupted the next turn. It pressed again whenever Claude Code's record did not read idle within 5 s, and with the hooks module the nudge after an Escape opens a turn within a second. It now stops once the page's claim has closed or moved past the turn.
  • document/idle and document/mid-turn errored every sample. Their retry key delivery-eval-1 is one character shorter than the log admits.

Evals

parent-keeps-leaf-responsive gains a delegated-work-visible rubric (5/5, a guard), and website_eval records each hosted turn's time to its first words, to text showing in the reply, and to its answer.

Left for decision

  • After the coordinator's turn ends, the panel's status stops reading Working while its workers run, though Claude Code's record says busy.
  • What the 7 s reply target counts, and whether leaf response reply should report what leaf page check does to save a model call.
  • The note also proposes reading stdin only when asked (--text -), which needs no guess from the descriptor but changes the shipped instructions.

This was written by Claude Code on behalf of max-sixty

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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@max-sixty
max-sixty merged commit f38882d into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-a96d215a9a6ece578 branch October 20, 2026 10:20
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants