Repository navigation
Fold the site benchmark into verify_site, and post the delivery eval's comment to an idle session - #1238
Merged
Conversation
… comment to an idle session `benchmark-site.py` ran the same agent journey as `verify_site.py --agent` and differed only in printing JSON. The agent pass now writes its progress and profile to stderr and one JSON sample to stdout, so the production gate and the benchmark are one run; `deploy-site-dev.sh` calls it with `--agent`. Without `--release`, the agent pass reads the release from the origin's state, as the benchmark did, so it still measures an origin with no local build. `eval_claude_delivery.py` posted its comment five seconds after it saw the page URL, inside the agent's setup turn. The wait then ended mid-turn, the Stop hook delivered the comment, and the agent handled it in that same turn, so the stream held one `result`, the `results > 1` close never fired, and every session ran out the 600 s limit (both arms of the first round did). The comment is now posted once the setup turn's `result` arrives, so it reaches an idle session through the background-task notification the docstring describes, and the scorer counts only notifications after that turn. A four-round A/A run on the fixed harness finished every session, with no timeouts. The docstring's cost is corrected to about a dollar per session, measured. Tests: `test_the_agent_pass_emits_one_json_sample_for_local_and_remote_targets` replaces the benchmark CLI test and asserts stdout is only the JSON sample, and the post-presentation wait test reads its profile line from stderr. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # scripts/eval_claude_delivery.py
# Conflicts: # scripts/AGENTS.md # scripts/benchmark-site.py
leaf-agent
approved these changes
Sep 26, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 26, 2026
…delivery eval an ack reading and a mid-turn case (#1240) Two follow-ups to #1238's benchmark survey. **`verify-site-local.sh` becomes `verify_site.py wrangler`.** The shell script started `wrangler dev` with prewarm off, polled it, ran `verify_site.py`, and printed the Worker log on failure, which is the same lifecycle `local_adapter()` already ran in Python for the `local` target. Both targets now share `serving` (start, wait for readiness, terminate) and `logged` (collect output, print it beside any failure). CI, `publish-site`, `AGENTS.md`, `scripts/AGENTS.md`, and `/developing-leaf` call the new target. It also removes its own containers once wrangler exits: `wrangler dev` 4.130 stops each session's container but leaves its `proxy-everything` sidecar running, and no later run reclaims it, so each local run used to leak about three running containers. To tell its containers from those of another `wrangler dev` of this Worker (such as `npm run dev` in `worker/`), the run serves under a Worker name of its own, `lv<pid>`, which workerd puts in every container's name. Verified with real runs through Docker, including one beside a stand-in container named like another run's, which survived. **The delivery eval gets a sharper per-comment reading and a mid-turn case.** "Actions before ack" read 1 in every run because the one action was always the expected read of the wait's output, so it had no range. It is replaced by `ack`, the seconds from the delivery reaching the agent to its pickup (the agent's own share of pickup time), and `extra`, anything run before `leaf wait --ack` other than that read. Cases: - `idle`: a comment after the setup turn ends, then a second once that turn has ended, which only arrives if the ack re-armed the wait; - `mid-turn`: a comment posted while the setup turn runs, which the Stop hook carries in. The children now run with `--include-hook-events`, each stream record carries the time it was read, and `ROUNDS` drops to 2. One A/A round (same plugin in both arms): | session | route | pickup | reply | ack | extra | |---|---|---|---|---|---| | base idle #1 / #2 | notification | 6 s / 5 s | 9 s / 8 s | 5 s / 5 s | none | | head idle #1 / #2 | notification | 5 s / 5 s | 11 s / 8 s | 5 s / 4 s | none | | base mid-turn | Stop hook | 10 s | 13 s | 6 s | read two references first | | head mid-turn | Stop hook | 8 s | 13 s | 4 s | none | On idle comments nearly all of pickup is the agent's own time; the notification lands within a second of the comment. > _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.
Two benchmark fixes from a survey of Leaf's measurement harnesses.
One site journey, not two.
scripts/benchmark-site.pyran the sameverify_agent_turnjourney asverify_site.py --agentand differed only in printing JSON. The agent pass now writes its progress and timings to stderr and one JSON sample to stdout, so the production gate and the benchmark are one run, andbenchmark-site.pyis deleted.deploy-site-dev.shcallsverify_site.py ORIGIN --release … --agent. Without--release, the agent pass reads the release from the origin's state as the benchmark did, so it still measures any origin (production included) with no local build. The sample's description moves intoverify_site.py's module header.The delivery eval measured the wrong route and never ended a session.
scripts/eval_claude_delivery.pyposted its comment 5 s after it saw the page URL, which was still inside the agent's setup turn. Theleaf waitthen ended mid-turn, the Stop hook delivered the comment, and the agent handled it in that same turn. The stream held oneresult, theresults > 1close never fired, and every session ran out the 600 s limit (both arms of a first run did). The comment is now posted once the setup turn'sresultarrives, so it reaches an idle session through the background-task notification the docstring describes, and the scorer counts only notifications after that turn.A four-round A/A run on the fixed harness (both arms on the same plugin code) finished all eight sessions with no timeouts:
So the noise floor is about ±2–3 s at four rounds, and "actions before ack" read 1 in every run, which means it can't tell arms apart. Each session cost about $1, and the docstring now says so. That run predates #1216's child isolation.
Tests:
test_the_agent_pass_emits_one_json_sample_for_local_and_remote_targetsreplaces the benchmark CLI test. It asserts that stdout is only the JSON sample and that a remote agent pass needs no local manifest. The post-presentation wait test now reads its profile line from stderr.🤖 Generated with Claude Code