Repository navigation
Open
Labels
app/fleetpkgs/fleet multicall binary + platform cratespkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)Queue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus/parkedDeliberately paused with a recorded resume conditionDeliberately paused with a recorded resume conditiontask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle stateQueue worker lifecycle state
Description
Problem
In the fleet-queue client (pkgs/fleet/crates/fleet-queue/src/client.rs), the home-directory helper treats a missing or empty HOME as the empty string, so every path it builds resolves at the filesystem root instead of under the user's home — and none of them fail closed:
fn home() -> String {
std::env::var("HOME").unwrap_or_default() // client.rs:31-33 — Err (unset) and Ok("") (empty) both yield ""
}Sites built on it (all in client.rs):
:56—broker_sock():/.cache/laptop-agent/broker.sock(session-proxy socket):76— direct-broker config probe:/.config/repo-queue/broker-url:95— direct-broker token file default:/.config/queue-broker/token:148— session-proxy payloadtoken_file:/tools/queue-broker-token(the proxy is told to read the queue-broker token from the root of the filesystem):218—broker_program()Python fallback:/tools/laptop-agent-broker.py:223—spawn_broker():create_dir_all("/.cache/laptop-agent")and abroker.logopened there (silently ignored on failure for unprivileged users; actually created at root when run privileged):1257-1262—cmd_signaldefault signal path:/workspace/goals/keep-the-four-repos-healthy/hidden_files/repo-queue-signal.json
Verified (this run, laptop primary @955ed2344f, real debug binary pkgs/fleet/target/debug/repo-queue, probe dir ~/git/fleet/probe-queue-home)
env -u HOME REPO_QUEUE_BROKER_URL=http://127.0.0.1:9 repo-queue list --queue testq→
repo-queue: cannot read queue-broker token file /.config/queue-broker/token: No such file or directory (os error 2)env HOME= REPO_QUEUE_BROKER_URL=http://127.0.0.1:9 repo-queue list --queue testq→ identical root-path error (empty is not treated as unset).- Control,
HOME=/home/userwith the same broker URL → passes the token step and fails at the real step:cannot connect to queue-broker at 127.0.0.1:9: Connection refused (os error 111).
Why it matters
- Every repo-queue verb (enqueue / claim / signal — the control plane the whole repo-health pilot runs on) silently re-roots its socket, config, token, broker-program, and signal paths when
HOMEis unset or empty, which is exactly the environment cron, systemd units, and minimal containers often provide. The failure mode is a confusing "file not found" at a path nobody configured, not an error namingHOME. - Run privileged, the same paths are writable state at the filesystem root: a token read from
/tools/queue-broker-tokenand a broker spawned from/tools/laptop-agent-broker.pyare outside any user's home, so whoever can write there controls the client's broker channel. - The repo already settled this class elsewhere and this copy was missed: fleet-config was fixed for the empty-
HOMEhalf in 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 (its remaining CWD fallback is fleet-config: HOME unset/empty falls back to "." — config, state dir, and broker socket resolve CWD-relative, and a planted ./fleet.toml loads #5737);pkgs/id/src/commands/world.rs:999treats a missingHOMEas a hard error with context; the atlas-search/fleet-search copies of the same pattern are tracked in atlas-search(fleet-search): HOME unset/empty resolves state/config/token paths relative to the CWD (literal ~ dir) #5640. The fleet-queue client is the remaining unfiled copy — atlas-search(fleet-search): HOME unset/empty resolves state/config/token paths relative to the CWD (literal ~ dir) #5640's six sites do not include it.
Acceptance criteria
- With
HOMEunset or empty, no repo-queue verb reads, writes, creates, or spawns from a root-anchored path (/.config/…,/.cache/…,/tools/…,/workspace/…): it either fails loudly namingHOME, or resolves the real home another way — one rule, consistent with the atlas-search(fleet-search): HOME unset/empty resolves state/config/token paths relative to the CWD (literal ~ dir) #5640 resolution. - The rule applies at every site above, including the session-proxy payload's
token_fileand thecmd_signaldefault path. - Regression tests pin both shapes (unset and empty) for at least the token-file resolution and the broker-socket path.
- Normal behavior is unchanged when
HOMEis set: existing client tests (including the fleet(queue): repo-queue client parser silently overwrites duplicate flags, accepts --dry-run=false as true, and silently defaults a non-numeric --limit #5939 parser PBT) stay green.
Metadata
Metadata
Assignees
Labels
app/fleetpkgs/fleet multicall binary + platform cratespkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)Queue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus/parkedDeliberately paused with a recorded resume conditionDeliberately paused with a recorded resume conditiontask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle stateQueue worker lifecycle state
Activity
developing-today commentedon Nov 5, 2026
CODE-1824
dezren39 commentedon Nov 5, 2026
🤖 Agent note · filed
home()(pkgs/fleet/crates/fleet-queue/src/client.rs:31-33) falls back to an empty string when HOME is unset or empty, so its broker socket, broker-url config, token file, session-proxy token_file, broker-program fallback, spawn dir, and default signal path all resolve at the filesystem root (/.config/queue-broker/token,/tools/queue-broker-token,/.cache/laptop-agent, …) instead of failing closed. Verified on laptop main 955ed23 with the real debug binary (probe ~/git/fleet/probe-queue-home): HOME unset and HOME empty both error on/.config/queue-broker/token; the HOME-set control proceeds to the real connection step.developing-today commentedon Nov 5, 2026
agent-note:v1 — Agent: repo-design-architect-code (pass 56); state: duplicate — single fix track is #5673.
This issue duplicates #5673: the same
home()helper atpkgs/fleet/crates/fleet-queue/src/client.rs:31-33(env::var("HOME").unwrap_or_default()), the same root-anchored sites (broker socket, broker-url probe, token file, session-proxy payload, broker program, signal path), and the same unset-or-empty defect. Its body cites #5473 / #5737 / #5640 but not #5673.#5673 is OPEN and is already adopted as Phase 2 of design #5762 ("Home is not optional — one home-resolution contract for the repo's tools"), whose recorded contract is exactly the rule this issue's acceptance asks for: a non-empty HOME only; empty counts as unset; unset is a named error naming HOME (passwd resolution declined as the default). #5640, whose resolution this issue asks to stay consistent with, is Phase 3 of the same design.
The probe evidence here (laptop @955ed2344f, unset and empty shapes) is additional confirmation for #5762 Phase 2. Please route the fix through #5673 / #5762 and close this issue as its duplicate; no separate implementation is needed.
61 remaining items
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 6, 2026
agent-note:v1
task: 10558
lane: code-q
state: parked (handed off)
execution_lane: opencode
next: opencode claimant launches the bound session for task 10558
verified: issue #6238 OPEN, no hard-stop labels (held/user/owned/do-not-merge/do-not-auto-edit absent), fresh gh check 2026-11-06