Repository navigation
Description
fleet-config: empty/blank config-file strings are used verbatim — broker_socket="" resolves to the home directory itself, and a blank dispatch url overrides as Some("")
Summary
fleet-config is careful about empty environment values: env_path filters them out (#5473), and dispatch_url()'s own doc says of FLEET_DISPATCH_URL that "empty counts as unset, as with every env path here". Empty or blank config-file strings get no such treatment: the accessors use them verbatim. A fleet.toml with broker_socket = "" makes the broker socket path the home directory itself; token_file = "" does the same to the secrets token-file path; [dispatch] url = "" (or all-whitespace) is returned as a configured URL, Some(""); token_name = "", target_host = "", and connect_udp_listen = "" likewise surface as empty values instead of their documented defaults.
This breaks the crate's stated config policy (crate docs, lib.rs:14-16): "a malformed file is a loud error, never a silent fallback". An empty string in a path/URL/name field is a misspelling-class error — a templated config rendering a variable that came out empty — and every env-side equivalent in this same crate is already treated as unset for exactly that reason.
Distinct from the filed siblings: #6397 covers [[proxy.services]] row values (duplicate/zero ports, empty service names); #6396/#5737 cover env-base resolution. No filed issue covers the scalar string fields of [proxy]/[secrets]/[dispatch].
Evidence (file:line, origin/main @ 2871969; fleet-config lib.rs is byte-identical between laptop HEAD 1dae17e and origin/main, md5-verified this run)
pkgs/fleet/crates/fleet-config/src/lib.rs:302-320—broker_socket_from: the env source goes throughenv_path(empty filtered), butSome(p) => resolve_under(home, &PathBuf::from(p))for the config value has no empty check;resolve_under(home, "")ishomeitself.pkgs/fleet/crates/fleet-config/src/lib.rs:430-436—secrets_token_file:Some(p) => resolve_under_home(p)— same empty-to-home resolution.pkgs/fleet/crates/fleet-config/src/lib.rs:390-396—dispatch_url: the env branch trims and rejects empty (Ok(v) if !v.trim().is_empty()), the config branch isself.dispatch.url.clone()verbatim.pkgs/fleet/crates/fleet-config/src/lib.rs:324-330—target_host:as_deref().unwrap_or(DEFAULT_TARGET_HOST)—Some("")wins over the default.pkgs/fleet/crates/fleet-config/src/lib.rs:350-356—connect_udp_listen: same shape againstDEFAULT_CONNECT_UDP_LISTEN.pkgs/fleet/crates/fleet-config/src/lib.rs:398-403—dispatch_token_name: same shape againstDEFAULT_DISPATCH_TOKEN_NAME.- Contrast inside the same file:
search_url()(:415-421) andsearch_via()(:406-412) do trim/filter their config values — the scalar fields above are the inconsistent remainder.
Verification (this run, laptop, real fleet-config crate)
Probe ~/git/fleet/probe-fleet-config-empty-rel (cfg bin; path-depends on the real fleet-config crate; HOME=/home/tester; each case is a real Config::load_from on a written temp fleet.toml):
empty broker_socket -> "/home/tester/" (the home directory itself)
empty secrets token_file -> "/home/tester/" (the home directory itself)
empty dispatch url -> Some("")
blank dispatch url " " -> Some(" ")
empty dispatch token_name -> ""
empty target_host -> ""
empty connect_udp_listen -> ""
control broker_socket "sock/b.sock" -> "/home/tester/sock/b.sock"
control dispatch url "http://127.0.0.1:9" -> Some("http://127.0.0.1:9")
control dispatch token_name "tok.name" -> "tok.name"
Every empty/blank case loads with no error and surfaces the empty value; every control resolves as documented.
Why it matters
- A templated or generated
fleet.tomlthat renders a variable empty (the routine failure the env-side filtering exists for) does not fail loudly: the session broker tries to use the operator's home directory as a Unix socket path, the secrets flow names a directory as its token file, and the dispatch client is handed an empty base URL that outranks the working default — each surfacing later as an opaque connect/read error far from the config mistake, or, fortarget_host = "", as a dial to an empty host. - The crate already decided this question for env values and for
[search]; the remaining fields are an inconsistency, not a design choice.
Acceptance criteria
- Empty or all-whitespace values for
broker_socket,secrets.token_file,dispatch.url,dispatch.token_name,proxy.target_host, andproxy.connect_udp_listenin the config file are either treated as unset (falling back to the documented default, matching the env-side rule) or rejected at load with a loudConfigError— one consistent shape, triage's call. - No accessor can return the home directory itself as a socket/token-file path, an empty string as a configured dispatch URL, or an empty token name / target host / listen address.
- Pinning tests cover empty and blank spellings for each affected accessor alongside the existing
dispatch_settings_*/proxy_settings_*tests; valid values resolve exactly as before. - No change to env-var handling (already correct) or to valid configs.
Activity
developing-today commentedon Nov 6, 2026
CODE-1914
dezren39 commentedon Nov 6, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
opencode143 remaining items
dezren39 commentedon Nov 11, 2026
agent-note:v1
🤖 Triage complete — Task 10832 completed. Source review and recommended validation approach are recorded above; implementation follow-up task 14872 is queued. The executable probe was not rerun during triage.
Merge pull request #8550 from developing-today/queue/14872-6405-blank…
dezren39 commentedon Nov 11, 2026
🤖 Agent note · done
Config::validateinpkgs/fleet/crates/fleet-config/src/lib.rsnow rejects an empty or whitespace-only config-file value for[proxy] broker_socket,[proxy] target_host,[proxy] connect_udp_listen,[secrets] token_file,[dispatch] url, and[dispatch] token_nameat load with a field-namingConfigError::Parse— the same misspelling-class treatment as the fleet-config: zero numeric values are never validated — egress_proxy_port=0 and dispatch port=0 dial port 0, and idle_exit_secs=0 makes the broker exit within seconds #6412 zero rule. The configured value is never echoed in the error. Env behavior, nonblank values, and defaults are unchanged;[[proxy.services]]rows (fleet-config: [[proxy.services]] is never validated — duplicate ports silently collapse last-wins in the broker's routing map, and port 0 / empty names load #6397) untouched.blank_scalar_strings_are_a_loud_errorcovers both spellings of all six fields plus valid and omitted controls;cargo test -p fleet-config— 45 passed, 0 failed;cargo fmtclean. Codex review on PR fix(fleet-config): reject blank scalar config values at load (#6405) #8550 completed with zero findings. PR checks were queued in the fleet runner backlog at merge (no failures); merged under standing merge authority on the local verification.