Prose review — PR #548, "Add request latency histograms and process metrics"
Head reviewed: a34c4d06 (commits ebecef13, d64c3ea3, a34c4d06), base main, draft, 10 files +548/−25, no reviews, no CI checks on the head. Review lens: prose only — the description, the docs it adds, and the code comments it changes.
Rules applied, all read this round:
AGENTS.md:43-50— every prose artefact, PR descriptions included, is reviewed against.agents/skills/repo-prose/SKILL.md(not opened).AGENTS.md:72-80— the four questions, in order: why, what exactly changed, claimed benefit/result, evidence.AGENTS.md:88-94(explicit before/after, no mixed tense),:95-102(expectation vs measurement, scope and limitations attached),:103-112(connect each claim to checks; keep skipped checks and limitations visible; explain differences that would otherwise look contradictory),:114-128(reference resolution / durable identifiers),:134-137(do not publish a description whose material limitations must be guessed).docs/design-review.md:137-152— principle 16: the same four-part scheme for commit bodies and PR descriptions; reject unexplained references and unsupported claims.docs/design-review.md:153-160— principle 17: Discord line after the technical explanation..agents/skills/repo-prose/SKILL.md:13-46(not opened) and:48-59.
Key findings
Verdict: should-fix issues only. No blocking prose finding. The description answers why / what changed / claimed result / evidence in that order, labels its claim as observability-only, states that no performance or memory improvement is claimed, states that cancelled and failed requests are excluded from the request histograms, and discloses the checks that were not run; Discord: oystersmiles is present (docs/design-review.md:153-160). The two should-fix items are narrow: one stale clause in the description, one false-as-written sentence in docs/api.md. Everything else is nits.
Should fix
1. Description, "What changed → HTTP", first bullet omits the tool-limit exclusion the code and docs encode
The bullet reads: "flare_request_e2e_seconds is observed when delivery completes a successful response, except for /v1/messages/count_tokens." At head the observation is guarded by two conditions, not one — helios/src/server/http.rs:598-600:
// One observation per successful response: a tool-limit cancellation reaches
// this point but the runtime counts it as cancelled, so it is excluded.
if !count && !encoder.tool_limit_reached {
state.model.metrics().request_e2e.observe(...);
}
yield Delivery::Complete(response);
The exclusion is pinned by helios/src/server/runtime/phase_tests.rs:4604-4613 ("A tool-limit cancellation completes delivery but is not a successful generation, so it records no end-to-end observation", asserting \nflare_request_e2e_seconds_count 0\n), and the runtime side confirms it: tool-limit paths bump cancelled (helios/src/server/runtime.rs:1317, :1338, :1360, :1407) and never call request_completed.
Why it matters: AGENTS.md:88-94 and docs/design-review.md:143-145 require the before/after to be explicit and complete, and AGENTS.md:134-137 forbids publishing a description whose material limitations must be guessed. An operator reconciling flare_request_e2e_seconds_count against flare_requests_completed_total will look for a gap in exactly the case the bullet says cannot exist. The bullet is stale relative to d64c3ea3, which added the guard.
Fix (description only): "…except /v1/messages/count_tokens and responses the runtime counts as cancelled, such as a parallel tool-limit stop", matching docs/api.md:303-306 and the comment at http.rs:598-599.
2. docs/api.md:315-316 — "Cancelled and failed requests enter only …" is unscoped and false as written
The closing sentence of the runtime-histogram paragraph reads: "Cancelled and failed requests enter only flare_requests_cancelled_total and flare_requests_failed_total."
Read literally, a cancelled or failed request contributes to no metric except the two outcome counters. That is contradicted by the paragraph directly above in the same document and by the code:
flare_time_to_first_response_secondsis observed as soon as the client reads answer or reasoning text, regardless of how the request ends —helios/src/server/latency.rs:116-127(FirstResponse::outputobserves the histogram and the 60-second window), called from the SSE filter athelios/src/server/http.rs:614. A stream that delivers text and is then cancelled by the parallel-tool-limit path (http.rs:563-567;runtime.rs:1317/:1338/:1360/:1407) records a TTFR observation and no runtime one.helios/src/server/runtime/phase_tests.rs:4407-4434pins the analogous failed case:assert_eq!(snapshot.samples, u64::from(emit_text && poll_body))afterincoming[0].fail(...).flare_http_requests_totalalso counts every cancelled and failed request (helios/src/server/http.rs:142).
Why it matters: the paragraph's opener scopes the group ("The runtime histograms observe completed generations", docs/api.md:309), so a charitable reading is right, but the final sentence drops the scope and speaks about where those requests "enter", which reads as a statement about /metrics. It is precisely the sentence an operator will use to conclude that TTFR count and completion count can never diverge. Note the description already carries the scope word: "Cancelled and failed requests stay out of these histograms and appear only in …". This violates AGENTS.md:88-94 (exclusions complete) and the prose skill's requirement that a statement hold as written (SKILL.md:13-14).
Fix: one clause — "…enter only flare_requests_cancelled_total and flare_requests_failed_total among the runtime series", or reuse the description's "stay out of these histograms and appear only in …".
Nits
docs/api.md:303lead-in. "The HTTP histograms observe delivery." uses the implementation verb as the opening and the paragraph then switches subject at:309("The runtime histograms observe completed generations"). Naming the two groups on their own terms — HTTP-level response timing versus runtime per-request timing — would read better. (SKILL.md:22-25,:44-46.)docs/api.md:304-306, abandoned stream. "for a stream it is observed when delivery completes, which requires the client to drain the body" is exact but delicate: the observation now runs in the same poll that yields the terminal item (http.rs:598-606, thenyield Delivery::Complete(response)), so a client that reads every data frame and disconnects before requesting the next item records nothing. A half-clause naming that case would remove doubt. (AGENTS.md:103-112,SKILL.md:35-37.)- Description, "Claimed result": "nothing about serving changes". In the same diff each submitted step reads one monotonic clock (
runtime.rs:2189-2203) and each committed token performs two stores (runtime.rs:1774-1775), so "nothing … changes" can be read as "no cost". One clause ("no serving behaviour changes; each submitted step adds a clock read …") keeps it from being read as a performance claim. (AGENTS.md:95-102.) - Description, "Evidence": the measured tree is unidentified. "this commit was cherry-picked onto it" plus fork commit
5ffe4d54, while the branch now has three commits and the description never says which tree produced the numbers, or whether the two follow-up commits (d64c3ea3,a34c4d06) were in the container. Name the built SHA or say "the branch head". (AGENTS.md:122-128,SKILL.md:20-21.) docs/api.md:312-313does not say a preempted request's decode span includes the parked interval.Worker::parkmoves the wholeIncomingintoself.parkeduntouched (runtime.rs:2094-2121), readmission reuses it,first_token_nsisget_or_insertandlast_token_nsis overwritten per commit (runtime.rs:1774-1775), sorequest_completedcomputeslast - firstacross the gap (metrics.rs:470-479). A "decode rate" or tail derived from these histograms therefore includes scheduler/preemption stalls. One clause after "at least two generated tokens" fixes it. (AGENTS.md:103-112.)- Description, "Evidence": the 6-vs-5 observation gap is unexplained. "Counts gained 5 for each runtime histogram and 6 for the first-response histogram" for one window, attributed only to the instance "also serv[ing] this agent session's own requests". A reader cannot tell why the first-response count exceeds the runtime count by one; the two instruments observe at different points (
latency.rs:116-127vsmetrics.rs:452-480), so a request in flight that had already offered text (most likely here, since the scrape was taken under live traffic) or a cancelled stream that delivered text accounts for it. Say it once. (AGENTS.md:106-108.)
Checked and sound (no finding)
- Four-part order, framing, and caveats all hold: why (no distribution visible in a scrape; the runtime already counts completions in one place), what (before/after per component), claimed result ("Observability only", explicitly no performance or memory claim, cancelled/failed excluded), evidence (test names, live scrape with counts and sums, and the three checks not run).
- Changed code comments state invariants, not history:
metrics.rs:450-451("so the two cannot diverge"),http.rs:598-599,runtime.rs:2189-2190("Stamp here rather than at submission so a request that reaches a model step has one"),metrics/process.rs:1-6(sources, degradation rule, non-Linux behaviour),:24-25(state-character guard),:29-30(field-3 offset), test comments atmetrics.rs:1678-1679andphase_tests.rs:4604-4605,:4486-4487. No chronology, no lifecycle labels, no requirement on conversation history; no defect report or run journal enters the repository (AGENTS.md:52-60,SKILL.md:26-29,:38-39). - Earlier docs findings are resolved at head: eligibility split for decode/per-token (
docs/api.md:312-314vsmetrics.rs:470-479and the HELP strings atmetrics.rs:1406-1418); theprocess_*naming exception is now stated (docs/api.md:290) and the six series documented (:318-321, emitted atmetrics/process.rs:79-125); e2e end point and stream caveat (:303-306) matchhttp.rs:598-606; the vision-step note (:309-311) matches the stamp before theGraphKind::Visionsplit (runtime.rs:2189-2203vs:2208); "accumulate since server start" present (:297-298); the JSON exclusion is stated (:323-325). - Discord line present (
docs/design-review.md:153-160).
Open questions (not findings)
- "CI covers the first two" names no job, while
.github/workflows/native-serving.yml:56-68(not opened) does run the full helios suite on Linux and Windows for every PR; naming the check would satisfyAGENTS.md:108-109. - The two follow-up commit subjects ("Hoist completion values and tighten stat parsing", "Exclude cancelled responses and reuse host helpers") are change-log shorthand readable only against the diff, whereas
docs/design-review.md:139-145applies the four-part scheme to commit bodies. Commit bodies cannot be read from the history view, so this is unresolvable from the tooling and is recorded as a question, not a finding.
Nothing else was found in the changed prose; every changed file was read in context through this lens.