Key findings
- Blocking —
--features serverno longer compiles.helios/src/server/metrics/process.rs:68callscrate::runtime_core::open_descriptors(), butruntime_coreis declared only under#[cfg(feature = "runtime-core")](helios/src/lib.rs:22-26) and theserverfeature does not enable it (helios/Cargo.toml:25). This is a regression introduced by commitd64c3ea3("Exclude cancelled responses and reuse host helpers"). - Should fix — the new e2e exclusion is scoped per response, while runtime completions are per generation.
helios/src/server/http.rs:600gates the observation on a flag shared by all choices of the response. Reachability depends on whether any protocol accepts both tools and more than one generation (see caveat below); the structure is wrong even if today's config matrix hides it. - Nit —
parse_statsilently drops all stat-derived metrics on an unexpected state letter (process.rs:26), contradicting the module's own "only unreadable or unparsable sources are omitted" promise (process.rs:4-6).
Blocking 1 — process.rs references a feature-gated module; --features server stops building
Where: helios/src/server/metrics/process.rs:68
let open_fds = crate::runtime_core::open_descriptors();
Why it does not resolve.
helios/src/lib.rs:22-26declares the module conditionally:#[cfg(feature = "runtime-core")] pub mod runtime_core;. Without that feature the pathcrate::runtime_coredoes not exist.helios/Cargo.toml:21definesruntime-core = ["dep:serde", …]as a standalone feature;helios/Cargo.toml:25definesserver = ["dep:serde", "images", "grammar", "dep:axum", …]and does not listruntime-core. So--features serveralone fails to compile, and becauseprocess.rsis reached from the unconditional/metricsrender path, the wholeservermodule tree goes with it.
This is new on the pushed head. The only other references to crate::runtime_core under helios/src/server/ are gated: server/session.rs:10 (not opened), gated by server.rs:26-29, and server/runtime/prompt_tests.rs:13 (not opened), gated by #[cfg(all(test, feature = "runtime-core"))] at runtime.rs:3983. search_code for runtime_core under helios/src/server returns exactly these three hits; metrics/process.rs:68 is the sole ungated one. The gating in server.rs:26-29 shows the crate is meant to build with server alone.
Configurations that break. docs/model-development.md:99-100 (not opened) (cargo test … --features server --lib frontend::, --features server --test message_boundaries) and docs/scheduling-runtime-design.md:735-736 (not opened) (--features server --lib scheduler::, … --features server --lib server::runtime::phase_tests::). CI builds only runtime-core,server (.github/workflows/native-serving.yml:63 (not opened),68), and flare-cli/Cargo.toml:27 (not opened),44 and AGENTS.md:317 (not opened) also pass both features, so the documented server-only lanes are exactly the ones nobody exercises — which is how this got through.
The other two helpers the same commit adopted are fine, which isolates the mistake: crate::os::page_size() (process.rs:61) and crate::os::raise_open_file_limit(0) (process.rs:70) resolve on every platform because mod os; is unconditional (lib.rs:19) and os.rs:8 is pub(crate) use flare_eos::*;.
Fix. Move open_descriptors (helios/src/runtime_core/protection.rs:291-302) into eos/src/unix.rs beside page_size (eos/src/unix.rs:73-75) and raise_open_file_limit (:138-165), and re-export it through crate::os — the route the commit already used for the other two helpers, and where AGENTS.md:20-21 (not opened) puts host OS operations. Alternatively gate the call on feature = "runtime-core".
Verification status. Established by reading the cfg/feature graph (exhaustive: lib.rs:22-26, Cargo.toml:21,25, all runtime_core references under server/). There are no CI checks on head a34c4d06 and I could not compile here; cargo check --manifest-path helios/Cargo.toml --features server settles it in seconds.
Should fix 2 — the e2e exclusion is response-scoped, completions are per generation
Where: helios/src/server/http.rs:598-605
// 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);
tool_limit_reached is a single flag on the shared Encoder (protocol/encode.rs:89, set at :506 when !parallel_tool_calls and a second tool call begins) and is consulted without an index at every use site (http.rs:471-476, :526, :563-567). One response can carry several generations: generations: Vec<Option<Generation>> is built per choice at http.rs:351-353 from size = prepared.len() (http.rs:299, :217-220), each with its own decoder (decoders[index], http.rs:479-487, :525-527).
What goes wrong if a response spans both several generations and tools. Choice i finishes naturally while choice j is still running; the runtime counts i as completed and Metrics::request_completed has already run for it (runtime.rs:1841-1846, :1993-2001), observing flare_requests_completed_total plus queue, prefill, decode, TPOT and prompt-token histograms. Then j trips the tool limit and sets the shared flag; the single end-of-response test at http.rs:600 then suppresses e2e for the whole response, including the finished choice i. Result: flare_request_e2e_seconds_count < flare_requests_completed_total, and the new docs/api.md sentence "Cancelled and failed requests enter only flare_requests_cancelled_total and flare_requests_failed_total" is false for that choice — the very divergence the PR sets out to remove by funnelling the counter and histograms through one function (metrics.rs:452-480).
Reachability caveat (checked this round, and it matters). n > 1 is accepted only for Protocol::Completions (protocol/decode.rs:742-755), and tools/tool_choice are rejected outright for Completions (decode.rs:813-815). So on the current matrix a Completions response can hold several generations (n, or a prompt array via generation_count, server/inference.rs:198-209) but cannot carry tools, and the protocols that carry tools are restricted to one generation. I could therefore not show a request that reaches tool_limit_reached and more than one generation, so this may be latent rather than live today. It is still the wrong scope: the flag is per response while the completion counter is per generation, and a per-index decision costs nothing.
Fix. Decide per finished generation rather than per response — skip only when the termination actually used at http.rs:526 is crate::output::Termination::Cancelled (e.g. observe inside the GenerationEvent::Finished arm at http.rs:517-560, or carry a per-index "completed successfully" bit to the end of the loop). A test with n: 2 where one choice hits the tool limit pins both the intent and, if tools+multi-generation is indeed unreachable, documents that.
Nit 3 — parse_stat silently drops every stat-derived metric on an unknown state letter
Where: helios/src/server/metrics/process.rs:26
if !fields.next()?.chars().next().is_some_and(|state| "RSDZTtWXxKPI".contains(state)) {
return None;
}
The module doc (process.rs:4-6) promises that only unreadable or unparsable sources omit metrics. A perfectly valid /proc/self/stat whose state letter is outside that hard-coded alphabet returns None, removing process_cpu_seconds_total, process_virtual_memory_bytes, process_resident_memory_bytes and process_start_time_seconds together, silently, mid-scrape. The guard exists to bound the "unrelated text containing )" risk of the rfind(')') heuristic (process.rs:20-29); validating that the five values actually consumed parse as integers bounds the same risk without a fixed alphabet. Low practical risk on today's kernels; recorded because a whole block vanishing is hard to diagnose from a dashboard.
(A related, purely documentary nit: docs/api.md still says counter and gauge names start with flare_, which the six process_* series it now documents contradict.)
Verified correct (checked in code — no finding)
- Counter and histograms cannot diverge inside the runtime.
Metrics::request_completed(metrics.rs:452-480) is the only increment ofcompleted; both former directfetch_addsites now call it (runtime.rs:1841-1846user/text stop,:1993-2001natural finish).prompt_tokens/generated_tokensare hoisted so the histograms and theFinishedevent agree. - Per-generation semantics hold. Queue needs
first_scheduled_ns, prefill needsfirst_token_ns, both viasaturating_sub; decode and TPOT requiregenerated_tokens > 1(metrics.rs:462-479). A preempted request still yields one observation each, becauseRequestTimeslives inIncomingand parking/readmission reuses it (runtime.rs:2106-2121,:1334-1342), andreserve_and_packstamps every lane's first scheduled step (runtime.rs:2187-2203, called from submit at:2275). - Process metrics degrade source by source. Each series is rendered from an independently read source (
process.rs:62-125), so one unreadable/procfile omits only its own metrics and never fails the scrape.parse_stat's index arithmetic (utime→nth(10), stime, starttime, vsize, rss) matches the test fixture (process.rs:141-148), and the last-)heuristic handles a command name containing). process_max_fdsonly reads the soft limit —raise_open_file_limit(0)targets zero (process.rs:69-70,eos/src/unix.rs:138-165); no permission change is attempted.- Non-Linux compilation has no new libc reference. All
libcuse inprocess.rsis undercfg(target_os = "linux"), and the non-Linuxrenderdiscards its argument (process.rs:8-14);libcis a non-optional dependency already used under unix cfgs elsewhere (helios/Cargo.toml:50). Windows was not built (disclosed by the author). - Earlier findings are fixed on this head: the tool-limit path is now excluded from e2e at a single observation point before
yield Delivery::Complete(http.rs:598-606), the streaming body-drain asymmetry is documented, and the vision-step caveat is documented.
Rules applied
- Charter line 42 — check interactions across every supported configuration; finding 1 is precisely a configuration-matrix break.
AGENTS.md:20-21(not opened) — host OS operations belong in theeoslayer, which is both the fix for finding 1 and the reason the two sibling helpers are fine.AGENTS.md:182-186(not opened) (do not weaken stated guarantees) for finding 2's contradiction of thedocs/api.mdinvariant;AGENTS.md:194-199(not opened) (disclose unrun checks) — the author does disclose the Windows build and full suite.
Evidence limitations
- No CI checks exist on head
a34c4d06and no compiler was available here; finding 1 rests entirely on the cfg/feature graph read above. - The author's live scrape ran on a cherry-pick onto fork commit
5ffe4d54, not onmain, so it says nothing about this branch's build state or the feature matrix; the counts in it also include the agent session's own traffic. - The claim that this PR and #537 "merge in either order" is asserted, not tested; they touch different functions of
metrics.rs, so it is plausible.
Open questions
- Should a multi-generation response in which one choice hits the tool limit contribute e2e observations for the choices that completed? Finding 2's fix depends on that call, and a
n: 2tool-limit test would settle both the intent and whether the path is reachable at all. - Should
open_descriptorslive ineos/crate::os, per the rule the same commit followed forpage_sizeandraise_open_file_limit? That is both the minimal fix and the consistent one.