Explore scratchpad · NVIDIA/hyperflare-inference #689

Raw Markdown for agents: https://autobot.eidonix.com/p/42009f6a-975f-4f83-9e77-c7de9dff0fae.md

#1 [high] Change: what #689 does (verified from diff)

PR #689 (jcartu, opened 2026-12-02, head 2f72e1b, base main, 2 files +442/-23). Files: helios/src/server/http.rs (+86/-23), helios/src/server/runtime/phase_tests.rs (+356/-0).

Verified in code at PR head:

Key behavioral deltas beyond description wording: untyped errors previously wrapped into AdmissionError::Invalid before rejection_details, and are now mapped straight to HTTP 400 with to_string(); explicit AdmissionError::Invalid now yields code invalid_request (was invalid_request_error). No docs file changed.

#2 [high] Why: issue #446 is the sole driver, confirmed by yatesdr

#446 "Request-preparation failures render the generic invalid_request_error code instead of the typed error codes admissions failures use" (shieldstar, opened 2026-11-21 18:26, open, labels area:api, bug; updated 2026-11-21 18:38).

#3 [high] Change: verified producers of typed errors on the preparation path

Verified at PR head vs main:

#5 [high] Related work: no competing PR; same-file neighbours #692, #691, #638, #418

#6 [high] Project fit: docs/core-design.md already promises typed codes; api.md lists no codes

#8 [high] Claims and evidence: verified vs asserted; CI absent

Claims in the description vs what backs them:

  1. "preserve typed error codes ... on preparation failures" — backed by code (http.rs:119-132, 209-291) and two tests. Verified by reading: the mapping is correct for Error::Admission(_) and FrontendError::ImageDecode.
  2. "keeps untyped preparation validation errors on invalid_request_error" — supported: untyped errors are Error::Execution(ExecutionError::State) (error.rs:174-178) -> PreparationError::Http(400) -> Protocol::error -> code = kind = invalid_request_error. Test case at phase_tests.rs:8738-8759 uses max_tokens: 0.
  3. "explicit AdmissionError::Invalid now preserves invalid_request instead of flattening" — a behaviour change not present in issue #446's list of codes; verified in code and covered by test phase_tests.rs:8718-8735 (uses 5 stop sequences, stops.rs:23 etc.). Note this makes code diverge further from type for a common client mistake class.
  4. "no x-request-id and no failure_log for preparation failures" — verified by construction: failure_response does not call with_request_id, and log_failure stays in rejection (http.rs:32-41). Consequence not stated in the description: a preparation failure is also not logged to stderr, so operators lose the stage=admission code=... line for these rejections (previously they were also unlogged via error(), so no regression — it preserves the status quo).
  5. Claimed test totals: helios 1,880 passed / 84 ignored (lib 1,818 + 47 ignored; integration 62 + 37), flare 254, flare-cli 245. Cannot verify from here; note that #692 (same author, same day) reports 1,884 passed / 84 ignored for helios, and #691 reports 1,821 lib passed (47 ignored) + 62 integration (36 ignored) — i.e. the sibling PRs' counts differ from each other by 1-9 tests, consistent with each PR adding different numbers of tests on slightly different bases, but it means these totals are per-branch local runs without a shared commit.
  6. Limitations disclosed: no live GPU serving, no tests/server/test_protocols.py run. Consistent with the fact that every added test is a CPU/axum-level test through http::generate with a Fixture model and a stub mpsc channel, asserting receiver.try_recv().is_err() for zero model-queue admission (phase_tests.rs:8500-8792). Not claimed but true: no CI run exists on head 2f72e1b (orientation packet: "no checks"), so no external verification of the reported numbers. .github/workflows/native-serving.yml:63,68 runs exactly cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server, so CI would cover the new tests once it runs.

#9 [high] Reach: clients, operators, metrics, docs, compatibility

#11 [high] Amendment 1: head/scale/scope changed to 3 files at 4695d846

Amendment to report #10. Head moved 2f72e1b -> 4695d846 ("helios/server: preserve typed error codes on HTTP request preparation failures", jcartu, 2026-12-02 21:53Z).

#12 [high] Amendment 2: code split resolved; ImageDecode removed; new doc contradiction is the remaining finding

Amendment to report #10 (verified at head 4695d846).

  1. AdmissionError::Invalid no longer becomes the invalid_request code. helios/src/server/http.rs:124-132: Error::Admission(AdmissionError::Invalid(_)) => PreparationError::Http(StatusCode::BAD_REQUEST, error.to_string()), then error(_) -> Protocol::error (protocol/mod.rs:33-52) sets code = "invalid_request_error" for a 400. General invalid 400s therefore stay on "invalid_request_error", matching the unwrapped untyped errors (other arm, http.rs:130). So report #10's flagged client-visible string regression (explicit Invalid -> "invalid_request") is fixed; error_code's invalid_request (helios/src/server.rs:751) is no longer reachable from the preparation path (only from post-submission rejection calls at http.rs:356,361 if an Invalid arises there; for the stops/sampling/context cases those are already validated in request::prepare_validated_inference, e.g. helios/src/server/request.rs:337-339, 618-628, so the practical split is gone). Unit coverage: helios/src/server/http.rs:785-806 asserts Invalid and untyped Error::from("messages must be an array") both yield 400 + code == "invalid_request_error"; wire coverage: helios/src/server/runtime/phase_tests.rs:8700-8737 (stop strings > 4 -> stops.rs:63-71 AdmissionError::Invalid; max_tokens: 0 -> request.rs:615-616 plain string error).

  2. FrontendError::ImageDecode arm removed; the whole tree now has exactly one ImageDecode occurrence, the match arm at helios/src/server/request.rs:32, i.e. the variant is never constructed, and image decode failures are wrapped AdmissionError::Image at request.rs:1166 and 1194 (search_code over repo). Removal is sound and the report's ImageDecode branch flag is retracted. Consequence for the earlier "FrontendError variants still flatten" flag: request::prepare maps Asset/Template/Tokenizer/Input to AdmissionError::Invalid (request.rs:35), which now renders invalid_request_error on the wire, so that divergence is no longer client-visible. Flag withdrawn.

  3. Remaining doc finding (new, introduced by the docs edit): docs/api.md:250-251 still says "Malformed, unsupported, and over-context requests return HTTP 400 (invalid_request_error)", while the new sentence at docs/api.md:257-261 says over-context/typed 400s carry context_length_exceeded / unsupported_feature / invalid_grammar / invalid_image. The two statements contradict each other inside one paragraph, and the new sentence does not say that untyped 400s (bad JSON, bad Content-Encoding 415, invalid_request class) keep invalid_request_error. The protocol scoping of the new sentence is correct: Anthropic Messages bodies carry no code/param (protocol/mod.rs:45-50, 53-58).

  4. Test shape changed: unit test now http.rs:739-807; wire test phase_tests.rs:8438-8763 with make_state built from http_state_for + Arc::get_mut (phase_tests.rs:8444-8465) instead of a hand-rebuilt HttpState literal, and a new "4b" block asserting invalid_request_error for general 400s. Reviewer's should-fix and both simplify items are addressed.

  5. Unchanged conclusions from report #10: HTTP statuses unchanged (all preparation Admission variants -> 400 via server.rs:733-741; Capacity/Unavailable still 503); preparation failures still carry no x-request-id and no stderr failure_log (failure_response http.rs:26-31 vs rejection http.rs:32-41); they still increment only http_requests[metric] (http.rs:160) and not flare_requests_failed_total (metrics.rs:1091-1095), which is the #692 territory; issue #446 remains the sole driver; no competing PR.

#13 [high] Research summary

The new event (commit 4695d846 plus jcartu's 21:53Z reply and the Autobot review at 21:25Z) changes four things in my report #10 on PR #689; everything else stands. Full details are in scratchpad entries #11 and #12.

Scale/scope amended. Head is now 4695d846, not 2f72e1b: +440/−26 across 3 files instead of +442/−23 in 2 — helios/src/server/http.rs (+107/−23), helios/src/server/runtime/phase_tests.rs (+327/−0), and docs/api.md (+6/−3). The PR now documents the wire change, so my "no docs are touched, docs need no edit" line is retired.

Two findings retracted. (1) The invalid_request code split is fixed: helios/src/server/http.rs:124-132 routes Error::Admission(AdmissionError::Invalid(_)) to PreparationError::Http(400, …), which renders code: "invalid_request_error" via protocol/mod.rs:33-52 — the same as the untyped arm at http.rs:130, so error_code's invalid_request (helios/src/server.rs:751) is no longer reachable from preparation. Covered by http.rs:785-806 and phase_tests.rs:8700-8730 (5 stop strings → stops.rs:63-71; max_tokens: 0 → request.rs:615-616). (2) The FrontendError::ImageDecode arm is gone and the variant is never constructed anywhere (only remaining reference is request.rs:32; decode failures are wrapped AdmissionError::Image at request.rs:1166, 1194), so the removal is sound; with request::prepare's Asset/Template/Tokenizer/Input mapping to AdmissionError::Invalid now rendering invalid_request_error, the second divergence I flagged is no longer client-visible either.

New finding — the docs edit contradicts itself. docs/api.md:250-251 still says malformed, unsupported and over-context requests return 400 (invalid_request_error), while the added sentence at docs/api.md:257-261 says typed 400s carry context_length_exceeded, unsupported_feature, invalid_grammar, invalid_image. The two statements sit in the same paragraph, and the new sentence does not say that untyped 400s (invalid JSON, 415 unknown Content-Encoding, the invalid-request class) keep invalid_request_error; its protocol scoping is correct (Messages bodies carry no code/param, protocol/mod.rs:45-58).

Process amended. Scratchpad #4 is stale: one Autobot review now exists (2026-12-02 21:25Z, Changes Requested, 0 blockers / 1 should-fix / 2 simplify / 1 nit) and the author replied at 21:53Z addressing all four points; test shape changed to http_state_for + Arc::get_mut (phase_tests.rs:8444-8465) with a new "4b" invalid-request block. Still zero human review and no CI on 4695d846, so the reported totals (helios 1,880 passed / 84 ignored, flare 254 / 4, flare-cli 245 / 3) remain author-local.

Unchanged. Status codes still do not change (every reachable preparation Admission variant → 400 at server.rs:733-741; Capacity/Unavailable stay 503 and preparation cannot produce them); preparation failures still carry no x-request-id and no stderr failure_log (http.rs:26-31 vs 32-41), consistent with docs/core-design.md:1119-1121 and docs/api.md:258; they still increment only http_requests[metric] (http.rs:160), not flare_requests_failed_total (metrics.rs:1091-1095), which is #692 territory. Issue #446 remains the sole driver and no competing PR exists.

#14 [high] Errata for report #10: which parts are superseded at head 4695d846

Use this with notes #11 and #12 to amend report #10 (PR #689). Report #10 was written at head 2f72e1b; head is now 4695d846, so its scale, "no docs touched" and two of its Autobot-comment findings are superseded.

RETRACT (do not repeat as open issues):

  1. "explicit AdmissionError::Invalid now returns code: invalid_request (client-visible string change beyond #446's four codes)" — fixed. http.rs:124-132 sends Invalid to PreparationError::Http(400, msg); Protocol::error sets code = "invalid_request_error" for 400 (protocol/mod.rs:33-52, 42). Unit test http.rs:785-806; wire test phase_tests.rs:8700-8730 (5 stop strings -> stops.rs:63-71 AdmissionError::Invalid; max_tokens: 0 -> request.rs:615-616 plain string). server.rs:751's "invalid_request" is now only reachable from post-submission rejection (http.rs:356, 361).
  2. "FrontendError::ImageDecode branch is unreachable" — the arm was deleted from preparation_error; the variant is never constructed anywhere (single remaining reference is the match arm at request.rs:32; image decode failures are wrapped AdmissionError::Image at request.rs:1166, 1194). Sound to remove.
  3. "FrontendError Asset/Template/Tokenizer/Input flatten to invalid_request_error, diverging from request::prepare (request.rs:35)" — no longer client-visible, because request::prepare also maps them to AdmissionError::Invalid (request.rs:35), which now renders invalid_request_error. Withdrawn.

AMEND: 4. Scale/scope: +440/-26 in 3 files at 4695d846 (http.rs +107/-23, phase_tests.rs +327/-0, docs/api.md +6/-3). Report #10's "+442/-23 in 2 files" and "no docs are touched / docs need no edit" are wrong now. 5. Process: report #10 said no review exists. There is now one Autobot review (2026-12-02 21:25Z, Changes Requested, 0 blockers / 1 should-fix / 2 simplify / 1 nit) and an author reply at 21:53Z claiming all four points addressed; test shape did change (http_state_for + Arc::get_mut at phase_tests.rs:8444-8465, new "4b" block phase_tests.rs:8702-8730). Still zero human review and no CI checks on 4695d846; totals remain author-local (helios 1,880 passed / 84 ignored, flare 254 / 4, flare-cli 245 / 3). 6. Unit test is now http.rs:739-807 (was cited as 739-786); wire test phase_tests.rs:8438-8763.

NEW FINDING (the only open docs defect): docs/api.md:250-251 says malformed/unsupported/over-context return 400 (invalid_request_error) while the new sentence at docs/api.md:257-261 says typed 400s carry context_length_exceeded/unsupported_feature/invalid_grammar/invalid_image — contradictory within the same paragraph, and the new text omits that untyped 400s (invalid JSON, 415 unknown Content-Encoding, invalid-request class) keep invalid_request_error. Protocol scoping is correct: Messages bodies carry no code/param (protocol/mod.rs:45-50, 53-58).

STILL VALID (unchanged by the event):

#4 [medium] Process: #689 state — no CI, no reviews, no labels

PR #689 state as of analysis (2026-12-02): open, "ready for review" per orientation packet, no labels, 0 reviews, 0 comments/discussion, no CI checks on head 2f72e1b ("CI on the head commit: no checks"), authored and last updated same day it was opened (fresh; ~0 hours old). Files changed: helios/src/server/http.rs (+86/-23), helios/src/server/runtime/phase_tests.rs (+356/-0). No docs changed. Single commit on branch fix/preparation-typed-error-codes: 2f72e1bb "helios/server: preserve typed error codes on HTTP request preparation failures" (author Joshua Cartu). Description includes "Discord: jcartu".

#7 [medium] People: author history and area ownership

jcartu (Joshua Cartu), GitHub association CONTRIBUTOR, not among the charter's named priority contributors (@voipmonitor, @original-el8, @lukealonso). Activity: 3 merged / 3 closed / 10 open PRs in 180 days; merged work touching docs (3), helios/src (3), heliopause/src, helios, helios/proto. Merged helios/src commits on main: 0b09434d "Constrain strict function-tool arguments in native tool syntax (#418)" (2026-11-22), 85de9eae "Bind core-declared FP32 parameters into text forward graphs" (2026-11-28), 425ab2d4 "Refresh host prefix-cache recency on request completion (#416)" (2026-11-23). Open same-day cluster (all opened 2026-12-02, all with "Discord: jcartu"): #689 (this, 20:48), #691 (20:54), #692 (20:54), #693 (perf scheduler survival-curve caching), plus #687, #688, #690, #686 also 2026-12-02 and #642, #621. This is a broad batch submission; three of them (#689, #691, #692) touch helios/src/server/http.rs simultaneously. Review history for this author: #621 received Autobot reviews (Changes Requested then Ready To Merge after rebase), #638 was an autobot-authored PR. jcartu engages with Autobot review threads (case files opened on their PRs). Who normally works in this area: Luke Alonso (237 commits in helios/src/180d), Martin Vit (52), yatesdr (49). Recent http.rs/server.rs committers: flare-autobot (#638), jedi95 (#317), yatesdr (#176, #167, #333), Luke Alonso (dc0d40e0 hardening of HTTP ingress 2026-11-19). yatesdr confirmed #446 by reading — a signal a maintainer has already endorsed the problem. Notably absent so far on #689: any human review, and no Autobot case-file comment yet (unlike #621/#638 which got one within minutes) — possibly because it is still under 90 minutes old.