feat: Surface the health payload's backend and decoding_strategy - #5
Closed
alex-dr wants to merge 1 commit into
Closed
feat: Surface the health payload's backend and decoding_strategy#5alex-dr wants to merge 1 commit into
alex-dr wants to merge 1 commit into
Conversation
`HealthMetadata` gains optional `decoding_strategy` and `backend` fields, so the two informational identifiers the service advertises on `/healthz` reach SDK callers and `jointfm health` instead of being dropped during parsing. Both are typed `str | None` and parsed with `_optional_string`, which tolerates a missing key and an explicit null alike. The service emits `decoding_strategy` as null for architecture-backend containers and for checkpoint configs predating the field, and omits `backend` entirely on images built before it landed, so neither can be required without breaking older deployments. Neither field is validated. `decoding_strategy` is singular rather than a `supported_*` list because the strategy is fixed at training time and no request field can select another, so it constrains nothing the SDK could check; mirroring the service's closed vocabulary as a `Literal` would only make an older client hard-error on a deployment that adds a fourth strategy. Callers still need it to read responses: only `autoregressive` couples horizons, so under either parallel strategy `samples` are per-horizon marginal draws rather than coherent sample paths. The inline health payloads in `tests/test_transport.py` and `tests/test_configuration.py` deliberately keep omitting both fields, so the suite covers older payload shapes next to current ones. Service side: datarobot/joint `feat/healthz-decoding-strategy`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
alex-dr
requested review from
DRMetaplectic,
j1z0,
mariusvilkas and
shackmann
as code owners
August 17, 2026 18:13
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
HealthMetadatagains optionaldecoding_strategyandbackendfields, so the two informational identifiers the service advertises on/healthzreach SDK callers andjointfm healthinstead of being dropped during parsing.Pairs with the service-side change in datarobot/joint (feat/healthz-decoding-strategy), which adds
decoding_strategyto the health payload alongside thebackendfield that landed earlier.Behavior
Both fields are typed
str | Noneand parsed with_optional_string, which tolerates a missing key and an explicit null alike:decoding_strategyas null for architecture-backend containers and for checkpoint configs predating the field.backendlanded omit that key entirely.So neither field can be required without breaking this client against older deployments. Both flow into
jointfm healthautomatically, since the CLI serializes the record withasdict.Neither field is validated.
decoding_strategyis singular rather than asupported_*list because the strategy is fixed at training time and no request field can select another, so there is nothing for the SDK to check. Mirroring the service's closed vocabulary (parallel_dense,parallel_scalable,autoregressive) as aLiteralwould only add a failure mode — an older client hard-erroring on a deployment that adds a fourth strategy.Callers still want the field to interpret responses: only
autoregressivecouples horizons, so under either parallel strategysamplesare per-horizon marginal draws rather than coherent sample paths. That caveat is now documented indocs/api-reference.md.Tests
health_metadatafixture advertises both fields, asserted intest_fixture_compatibility.pyso the fixture stays honest against the service contract.test_contract.pycover missing, explicit-null, and non-string payloads for each field.test_cli.pyasserts both reach thejointfm healthJSON output.test_transport.pyandtest_configuration.pydeliberately keep omitting both fields, so the suite exercises older payload shapes next to current ones.134 passed, 1 skipped.
ruff check,ruff format --check, andty checkall clean.🤖 Generated with Claude Code
Note
Low Risk
Additive, backward-compatible health parsing and documentation only; no changes to forecast requests, validation policy, or security-sensitive paths.
Overview
Health metadata now carries two optional, informational fields from the service:
backendanddecoding_strategy.HealthMetadata.from_payloadmaps them with_optional_string, so older deployments that omit the keys or send explicitnullstill parse without changing compatibility checks.jointfm healthand API docs pick up the same fields automatically (CLI serialization viaasdict). The reference notes thatdecoding_strategyhelps callers interpretsamples—parallel strategies yield per-horizon marginals, while onlyautoregressiveproduces coherent multi-step paths.Fixtures and contract/CLI tests assert the new fields; parametrized tests cover missing, null, and invalid non-string payloads.
Reviewed by Cursor Bugbot for commit a3c3e9d. Bugbot is set up for automated code reviews on this repo. Configure here.