GeezerVison is showing github.com — fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads · Issue #5737 · developing-today/code
fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737Descriptionfleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads
Evidence (verified this run, laptop primary @ a719a69)
pkgs/fleet/crates/fleet-config/src/lib.rs:198-200:
fn home_dir() -> PathBuf {
env_path("HOME").unwrap_or_else(|| PathBuf::from("."))
}
home_dir() feeds Config::file_path() (lib.rs:216-224), Config::state_dir() (lib.rs:396-398), and Config::broker_socket() (lib.rs:273-291, via resolve_under_home / resolve_under). #5473 made empty XDG/FLEET_* values count as unset, but when HOME itself is unset or empty — and no absolute XDG base is set — every one of these paths becomes relative to the process's current working directory.
Probe (laptop, ~/git/fleet/probe-fleetconfig-home, real fleet-config crate as a path dependency; run from a scratch dir containing a planted ./.config/fleet/fleet.toml with [domains] planted = false; environment explicitly scrubbed):
env -u HOME -u XDG_CONFIG_HOME -u XDG_STATE_HOME -u FLEET_CONFIG -u FLEET_BROKER_SOCKET:
file_path=./.config/fleet/fleet.toml
state_dir=./.local/state/fleet
broker_socket=./.cache/laptop-agent/broker.sock
Config::load() succeeds and domain_enabled("planted") == false — the planted CWD config was loaded (an unknown domain defaults to enabled; false can only come from the planted file).
HOME= (empty) with empty XDG bases: identical CWD-relative results, planted config loads.
- Control (
HOME=/home/user): all paths anchor under /home/user, planted CWD config ignored.
Note: a process environment that happens to set absolute XDG_CONFIG_HOME/XDG_STATE_HOME masks the config/state paths (the broker socket has no XDG source and stays CWD-relative), which is presumably why this survived #5473's fix — that issue covered empty XDG values given a present HOME.
Why it matters
- A fleet process started without HOME (cron, a minimal systemd unit,
env -i, a container) silently reads its configuration from whoever controls its working directory — the exact planted-config hazard fleet-config: empty XDG env vars resolve to CWD-relative paths (a planted ./fleet/fleet.toml is loaded), and a relative FLEET_BROKER_SOCKET bypasses under-HOME resolution #5473 closed for the XDG spelling of this bug.
- The broker socket and state dir landing in the CWD means two processes in different directories talk to different brokers / keep different state, with no error anywhere.
- Siblings, same class, different crates and different wrong anchors: atlas-search(fleet-search): HOME unset/empty resolves state/config/token paths relative to the CWD (literal ~ dir) #5640 (atlas-search / fleet-search, literal
~ CWD dir) and fleet-queue(client): HOME unset/empty makes home() empty — broker socket, token, and worker signal paths all anchor at the filesystem root #5673 (fleet-queue client, filesystem root). This one is fleet-config's own copy; neither sibling covers it.
Acceptance criteria
Activitydeveloping-today commented on Nov 5, 2026 dezren39 commented on Nov 5, 2026 dezren39 commented on Nov 5, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane code-k
- Session / ID: task 9786
- Found via: queue claim
- Task: task 9786 (triage, direct lane) for issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737: verify the fleet-config HOME-unset CWD-relative fallback evidence against current main and route the fix.
- Expectation: effort s; done = findings comment on issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737 and a fix task enqueued if the evidence holds.
- Links: issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737
developing-today commented on Nov 8, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane code-w
- Session / ID: task 12774
- Found via: queue claim (resume after lane code-t's park expired)
- Task: Resuming task 12774 from code-t's checkpoint: PR fix(fleet-config): passwd-home fallback when HOME is unset/empty/relative (#5737) #7425 (branch queue/12774-5737-home-anchor, commit 18c949e) implements the fleet-config passwd-home fallback for issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737; targeted tests were green on the laptop (cargo test -p fleet-config: 19 passed). I will verify the PR diff, checks, and Codex findings fresh, then merge on green/verified and complete task 12774.
- Expectation: effort s; done = PR fix(fleet-config): passwd-home fallback when HOME is unset/empty/relative (#5737) #7425 merged, issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737 closed, task 12774 completed as fixed_merged.
- Links: PR fix(fleet-config): passwd-home fallback when HOME is unset/empty/relative (#5737) #7425 · issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737
developing-today commented on Nov 8, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane code-w (implementation by lane code-t, task 12774)
- Session / ID: task 12774
- Found via: queue claim (resume after lane code-t's park expired)
- Task: PR fix(fleet-config): passwd-home fallback when HOME is unset/empty/relative (#5737) #7425 merged — fix(fleet-config): passwd-home fallback when HOME is unset/empty/relative. Verified fresh this shift: PR head was exactly the tested commit 18c949e (cargo test -p fleet-config: 19 passed on the laptop, per code-t's checkpoint), the diff matches every acceptance criterion of issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737 (passwd-home anchor, loud failure naming HOME, pinning tests for HOME unset/empty across file_path, state_dir, and broker_socket), and there were no Codex review findings to disposition. Merge commit 3bd1953; issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737 closed by the merge.
- Expectation: done — task 12774 completed as fixed_merged.
- Links: PR fix(fleet-config): passwd-home fallback when HOME is unset/empty/relative (#5737) #7425 · issue fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|