You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(health-check): expose --no-health-check CLI flag + REST escape hatch
boxlite-ai#613 makes the per-box health check task default-on so the new
zombie-shim reaper (Issue boxlite-ai#523) has a watcher to piggy-back on. The
schema field `BoxOptions.advanced.health_check: Option<HealthCheckOptions>`
already lets Rust library users opt out via `None`, but CLI users
(`boxlite run` / `create`) and REST/SDK clients (Python, Node, Go all
route through `POST /v1/boxes`) had no way to express that choice —
exactly the gap boxlite-ai#597 hit for `cap_overrides`.
Surface plumbed end-to-end:
- `ManagementFlags { no_health_check: bool }` — `--no-health-check`
on `boxlite run` / `create`. When set, `apply_to` clears
`opts.advanced.health_check = None`.
- REST client-side `CreateBoxRequest` gets
`health_check_disabled: Option<bool>`; `from_options` flips it to
`Some(true)` only when the operator already disabled health check
in the input options, so the wire form stays byte-identical for
every other call.
- Server-side `CreateBoxRequest` (in `cli/src/commands/serve/types.rs`,
`#[serde(deny_unknown_fields)]`) gains the same field. The
`build_box_options` mapper builds a manual `AdvancedBoxOptions`
instead of falling through `..Default::default()`, then forces
`health_check = None` iff the wire says so.
Three-state semantics for `health_check_disabled`:
- `Some(true)` → explicit disable; box runs with no watcher, no
zombie reaping (operator takes responsibility — documented inline).
- `Some(false)` → "use the server default" (= currently `Some(...)`).
Same effect as omitting the field, but documents the intent on
the wire.
- absent → server default. Pre-boxlite-ai#613 clients keep the legacy POST
body shape and get the new default-on behaviour without code
changes.
Seven unit tests cover the surface symmetrically:
- CLI: `management_flags_no_health_check_clears_advanced_field` /
`management_flags_no_health_check_unset_keeps_default_on` —
flag-on clears, flag-off preserves; pre-asserts the baseline
so a regression that broke the default-on schema would also fail.
- REST client: `test_create_box_request_carries_health_check_disabled_on_the_wire` /
`test_create_box_request_omits_health_check_disabled_when_default`
— `None` in BoxOptions → `Some(true)` on the wire; `Some(default)`
→ field absent (backward-compat with pre-boxlite-ai#613 servers).
- REST server: `build_box_options_health_check_disabled_true_clears_health_check` /
`build_box_options_no_health_check_field_keeps_default_on` /
`build_box_options_health_check_disabled_false_keeps_default_on`
— three-state JSON → BoxOptions mapping, including the explicit
"Some(false) means default" sentinel.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
0 commit comments