Skip to content

Benchmark a reply by its time, attributed to where it went - #3629

Merged
max-sixty merged 3 commits into
mainfrom
reply-time-benchmark
Oct 22, 2026
Merged

max-sixty merged 3 commits into
mainfrom
reply-time-benchmark

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Benchmark a reply by its time, attributed to where it went

The reply benchmark now measures the time from the user's comment to the agent's reply and attributes all of it, each moment once, instead of counting model calls. This follows Max's decision #40 on the overnight report: a count of model calls is a noisy proxy for the time the user waits, so the benchmark and the note's budgets are now in seconds.

reply_phases.reply_breakdown splits a reply into:

  • Leaf's share: delivery, Leaf's commands, and now Leaf's hooks where the harness times them;
  • the harness's own work before each request;
  • the model's wait for the stream's first output and its generation, with each response's output tokens;
  • the agent's other tools, the harness's busy time and idle time.

Each harness's record supplies a different part of this:

  • Claude Code: the journey reads its debug log. It pairs each first byte with its request by the elapsed time the log line states, so a prompt-suggestion stream running alongside isn't mistaken for the main thread's. The transcript gives each response's output tokens.
  • Pi: the first stream event and output tokens come from its RPC events.
  • Codex App Server: its hook durations and per-response token usage come from App Server notifications. App Server reports no request or stream start, so Codex's model time stays unsplit.

The journey now breaks the release reply down once, after the session ends, from its whole record. The call that replied keeps its tokens, and reading Claude Code's transcript while it is still being written can no longer fail the journey on a partial line.

leaf-dev journey-chart --replies prints a table with one column per target and case. Each part shows its mean and its share of the whole reply, and the parts add up to it. Model calls and output tokens remain only as diagnostic rows.

notes/user-feedback-responsiveness.md now carries:

  • a fresh batch of 18 journeys, three per harness and case;
  • which parts each harness gives exactly and which are inferred or missing;
  • budgets in seconds: whole reply under 15 s, Leaf's share under 2 s.

In waiting replies the model took 82–92% of the time, mostly generation: Claude Code generated at about 100 tokens a second, nearly all of it thinking. Leaf's hooks took 1.0–1.6 s a reply on Claude Code and Codex; nothing counted them before this change.

The TODO entry asking what the reply budget counts is removed: the budget counts the whole reply. The website journey test's fake run_journey and its expected sample were stale against #3387 and #3403. They now take commands and expect case.

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

max-sixty and others added 2 commits October 22, 2026 14:15
The reply benchmark is now the time from the user's comment to the reply,
attributed to Leaf's delivery, commands and hooks, the harness, the
model's wait for its first output and its generation, and the agent's
other tools. Model calls and output tokens remain only as diagnostics.
This follows Max's decision #40 on the overnight report.

Claude Code's debug log times each request, first byte and Leaf hook;
Pi's RPC events give each response's first stream event and tokens;
Codex App Server gives hook durations and per-response tokens, and its
model time stays unsplit. journey-chart --replies tabulates each part's
mean and share. The note's budgets are now in seconds, with a fresh
batch of 18 journeys.

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.

The Pi breakdown needs one correction before its per-response timings and token counts can be trusted.

Comment thread dev/leaf_dev/journey_pi.py Resolved
run_journey read Claude Code's transcript while the session was still
writing it, and a partial last line failed the journey with a
JSONDecodeError. The release reply is now broken down only in
User.sample, from the session's whole record, like every other step's
comment.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 4fed892 into main Oct 22, 2026
4 checks passed
@max-sixty
max-sixty deleted the reply-time-benchmark branch October 22, 2026 22:21
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