Repository navigation
refactor(error): move the error-class to HTTP status mapping into dynamo-error - #211
Draft
ishandhanani wants to merge 3 commits into
Draft
ishandhanani wants to merge 3 commits into
ishandhanani wants to merge 3 commits into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
November 12, 2026 08:32 — with
GitHub Actions
Failure
ishandhanani
force-pushed
the
idhanani/dyn-llm-split-error-status
branch
from
November 15, 2026 10:57
3e2dcbe to
701a175
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 15, 2026 10:57 — with
GitHub Actions
Failure
ishandhanani
force-pushed
the
idhanani/dyn-llm-split-error-status
branch
from
November 16, 2026 07:07
701a175 to
5ef13fd
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 16, 2026 07:07 — with
GitHub Actions
Failure
…amo-error The class-to-status policy lived in dynamo-llm's http::service::error, so backend, preprocessor, kv_router, generate_format and the gRPC service all imported the HTTP frontend module to render or assert an error status. Move it into dynamo-error as the `http` module behind a new `http` feature whose only added dependency is the `http` crate (the StatusCode axum re-exports): overload_status_code, ClientErrorAction, http_action_for_class, http_action_for_error, find_canonical_error_in_chain, SanitizedError and BackendStatusAction, with their 14 unit tests. Items are unchanged apart from visibility (pub(crate) to pub) and import paths. dynamo-error sits below dynamo-runtime, so the module names the DYN_HTTP_OVERLOAD_STATUS_CODE environment variable itself instead of importing the runtime's environment_names registry. HttpError (a thiserror type engines return to pick a raw status) and invalid_argument (a constructor only the protocol adapters use) stay in http::service::error. No re-exports: every caller imports dynamo_error::http. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
dynamo-error cannot import dynamo-runtime's environment_names registry, so DYN_HTTP_OVERLOAD_STATUS_CODE is now spelled in both crates. Assert the two constants agree from dynamo-llm, the lowest crate that sees both. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
State what the optional `http` feature adds to dynamo-error and that the `http` crate is its only extra dependency. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-llm-split-error-status
branch
from
November 16, 2026 20:34
5ef13fd to
fc1f85b
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 16, 2026 20:34 — with
GitHub Actions
Failure
This branch had an error being deployed
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.
Summary
Step 2 of splitting
lib/llminto smaller crates, and layer 1 of the 16-layer split stack:main<- #211 <- #209 <- #212 <- #213 <- #218 <- #219 <- #220 <- #221 <- #222 <- #223 <- #224 <- #225 <- #226 <- #227 <- #228 <- #229. The error-class to HTTP status policy moves out ofdynamo_llm::http::service::errorintodynamo-error, as thehttpmodule behind a newhttpcargo feature, sobackend,preprocessor,kv_routerandgenerate_formatno longer import the HTTP frontend module to render or assert an error status.dynamo_error::http:overload_status_code(withparse_overload_status_code),ClientErrorAction,http_action_for_class,http_action_for_error,find_canonical_error_in_chain,SanitizedError,BackendStatusAction(withkeeps_retry_semantics), and their 14 unit tests. Names, bodies, messages and status codes are unchanged; the only edits arepub(crate)topubon five items anddynamo_runtime::error::Xtocrate::X.dynamo_llm::http::service::error:HttpError(the type an engine returns to pick a raw status; it derivesthiserror::Error, a dependencydynamo-errordoes not take, and it is not class vocabulary) andinvalid_argument(apub(crate)constructor only the OpenAI and Anthropic adapters call). The file goes from 551 to 37 lines.httpadds thehttpcrate forStatusCode(the type axum re-exports) and nothing else.dynamo-errorwithout the feature is unchanged.overload_status_coderead the variable name fromdynamo_runtime::config::environment_names::llm.dynamo-runtimedepends ondynamo-error, so the module now spellsDYN_HTTP_OVERLOAD_STATUS_CODEitself; a new test indynamo-llmasserts the two constants agree. Same variable, same default (529), same parsing, same first-use caching.dynamo_error::httpdirectly.dynamo-llm,dynamo-sglang-generate,dynamo-vllm-generateand the Python bindings gain adynamo-errordependency withfeatures = ["http"].lib/llm/src/http/that importhttp::service::errorgo from 10 to 2 (lib/bindings/python/rust/http.rsandlib/llm/tests/http-service.rs, both forHttpError). Nodynamo-llmmodule outsidehttpimports it any more,grpcincluded.lib/llm/src/http/service/disconnect.rschanges on three import lines only, because the items it names moved and there is no re-export to fall back on.Validation
Baseline is upstream
mainat 8e7d29e, which this branch is rebased on. Baseline and after-runs used the same remote 32 vCPU builder.The numbers below were measured on that base. The stack has since been rebased onto upstream
maind20e045; after the rebase this layer's head passedcargo check --workspace --all-targets,cargo check --lockedinlib/bindings/python,cargo metadata --lockedfor the four lock files,cargo fmt --all -- --checkand the Anthropic admission tests, and the top of the stack passed the whole-workspacecargo test --lockedrun (10,022 passed, 0 failed, 87 ignored), clippy, and the bindings, machete, pre-commit, codeowners and OpenAPI checks.cargo test -p dynamo-llm -p dynamo-http-server -p dynamo-sglang-generate -p dynamo-vllm-generate -p dynamo-generate-format-catalog -p dynamo-global-frontend --no-fail-fastpluscargo test -p dynamo-error --all-features: before 65 test binaries, 4,825 passed, 0 failed, 33 ignored; after 65 test binaries, 4,826 passed, 0 failed, 33 ignored. The difference is the one new test.dynamo-llm4,623 to 4,610 (lib 3,999 to 3,986: 14 moved out, 1 added) anddynamo-error34 to 48 (lib 32 to 46: 14 moved in).dynamo-http-server56,dynamo-sglang-generate18,dynamo-vllm-generate37,dynamo-generate-format-catalog12 anddynamo-global-frontend45 are identical.cargo test -p dynamo-llm --lib -- --listgoes from 4,014 to 4,001 names. The 14 names that leftdynamo_llm::http::service::error::testsall exist asdynamo_error::http::tests::<same name>; one name is new (overload_status_env_name_matches_runtime_registry); no other test name changed in any binary.cargo check --workspace --all-targets: exit 0, also at each earlier commit of the branch, together withcargo checkinlib/bindings/python.cargo clippy --no-deps --workspace --all-targets -- -D warnings: exit 0.cargo check --lockedinlib/bindings/python: exit 0.cargo metadata --lockedpasses for the root,lib/bindings/python,lib/bindings/kvbmandlib/runtime/exampleslock files (the last needed no change).cargo machetein.,lib/bindings/pythonandlib/runtime/examples: no unused dependencies.cargo fmt --all -- --checkandpre-commit run --from-ref 8e7d29e0de --to-ref HEAD: clean.Closes DYNO-216