Repository navigation
Description
Problem
In the fleet-queue client (pkgs/fleet/crates/fleet-queue/src/client.rs, the repo-queue binary every fleet agent uses to enqueue / claim / signal), the home helper treats a missing or empty HOME as the empty string:
// client.rs:31-33
fn home() -> String {
std::env::var("HOME").unwrap_or_default()
}Every path the client derives is a format!("{}/...", home()), so with HOME unset or empty each one anchors at the filesystem root instead of the user's home:
client.rs:56— session-proxy socket:/.cache/laptop-agent/broker.sockclient.rs:76— direct-broker marker:/.config/repo-queue/broker-urlclient.rs:95— direct-broker token:/.config/queue-broker/tokenclient.rs:148— session-proxy payloadtoken_file:/tools/queue-broker-token(the laptop-side proxy is told to read the broker token from the root of its filesystem)client.rs:218— auto-start fallback program:/tools/laptop-agent-broker.pyclient.rs:223—spawn_brokerdoescreate_dir_all("/.cache/laptop-agent")and opens/.cache/laptop-agent/broker.logthereclient.rs:1221—cmd_signal's default signal path:/workspace/goals/keep-the-four-repos-healthy/hidden_files/repo-queue-signal.json— the file that wakes the queue worker lands at the root-anchored path, not the goal workspace, so the signal silently never reaches the worker
Same crate, secondary sites: the brokers handle unset loudly but let the empty half through — queue_broker.rs:592 and secrets_broker.rs:192 use std::env::var("HOME").expect("HOME unset"), so HOME="" yields the root-anchored token paths /.config/queue-broker/token / /.config/secrets-broker/token; secrets_broker.rs:45 reads the Bitwarden access token from {home}/.config/bitwarden/access-token with the same empty-home shape.
Evidence
Code read at current main 2db40a34e0 (via gh api raw reads; the laptop SSH route was down during this run, so no binary probe — the behaviour follows deterministically from the constructions above: env::var("HOME") errs on unset and returns "" on empty, unwrap_or_default() maps both to "", and format!("{home}/.cache/...") with home == "" is the root-anchored path shown).
Contrast inside this repo, i.e. the class is known and the fix shape exists:
- fleet-config was fixed for exactly this class 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 and now routes through a
non_empty_pathhelper (pkgs/fleet/crates/fleet-config/src/lib.rs). - atlas-search(fleet-search): HOME unset/empty resolves state/config/token paths relative to the CWD (literal ~ dir) #5640 tracks the sibling pattern in atlas-search / atlas-core / fleet-search (literal
~fallback, CWD-relative there). It does not name fleet-queue. pkgs/id/src/commands/world.rstreats a missingHOMEas a hard error with context.
Why it matters
repo-queue is invoked from cron jobs, systemd units, and agent shells — exactly the contexts where HOME is most often unset or empty. In that state the client does not fail: it connects to (or tries to spawn) a broker at root-anchored paths, reads a broker URL / token from files the operator never wrote, and writes the worker-wake signal to a path no watcher reads. The failure presents as a silently idle queue or a "cannot connect to session proxy" error pointing nowhere near the cause. If a root-anchored /.config/repo-queue/broker-url or token file ever exists (e.g. created by a root-run invocation), a later user-level client would silently trust it.
Acceptance criteria
- The client's home resolution treats an empty
HOMEas unset, and withHOMEunset/empty every verb either fails loudly namingHOMEor resolves the real home another way — one rule, shared with (or matching) fleet-config'snon_empty_pathapproach. - With
HOMEunset/empty, no fleet-queue verb reads, writes, creates, or spawns at a root-anchored path (/.cache/...,/.config/...,/tools/...,/workspace/...). - The brokers (
queue_broker.rs,secrets_broker.rs) treat emptyHOMEthe same as unset at the token-file / access-token sites. - Regression tests pin both shapes (unset and empty) for at least the broker socket path, the direct-broker token path, and the signal path.
- Behaviour with
HOMEset is unchanged: existing fleet-queue tests stay green and the paths resolve exactly as today.
Activity
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
home()(client.rs:31-33) isenv::var("HOME").unwrap_or_default(), so HOME unset/empty anchors every derived path at the filesystem root: broker.sock (client.rs:56), broker-url (:76), broker token (:95), session-proxy token_file (:148), broker auto-start program/log (:218/:223), and the worker-wake signal file (:1221). Verified by code read at main 2db40a3 via gh api (laptop SSH route down this run; the construction is deterministic string arithmetic, and the sibling pattern was binary-verified in atlas-search(fleet-search): HOME unset/empty resolves state/config/token paths relative to the CWD (literal ~ dir) #5640 / fixed for fleet-config 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 — neither covers fleet-queue). Brokers' empty-HOME half included as secondary sites.dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
home()empty-HOME behaviour at current main and route the fix.dezren39 commentedon Nov 5, 2026
🤖 Agent note · done
Triage findings (task 9755, verified 2026-11-05)
Confirmed — still present at current main. Fresh
gh apicontents reads this run:pkgs/fleet/crates/fleet-queue/src/client.rs(1332 lines): lines 31–32 are exactlyfn home() -> String { std::env::var("HOME").unwrap_or_default() }, and line 56 still derives the broker socket asformat!("{}/.cache/laptop-agent/broker.sock", home())— soHOMEunset or empty anchors every derived path at the filesystem root, as issue fleet-queue(client): HOME unset/empty makes home() empty — broker socket, token, and worker signal paths all anchor at the filesystem root #5673 describes.pkgs/fleet/crates/fleet-queue/src/queue_broker.rsline 592:std::env::var("HOME").expect("HOME unset")— loud on unset, silent on empty.pkgs/fleet/crates/fleet-queue/src/secrets_broker.rsline 192: sameexpect("HOME unset"). One nuance vs the issue text: line 45 usesstd::env::var("HOME").ok()?rather than the same construction — the effect for emptyHOMEis the same (an empty string passes through and the access-token path anchors at root), so the acceptance criteria cover it unchanged.Issue #5673 is OPEN with no hard-stop labels (
held,user/owned,do-not-merge,do-not-auto-editall absent) and no matching PR. The in-repo fix shape from #5473 (fleet-config'snon_empty_path) is the reference the acceptance criteria already name.Routing: enqueued as task 9770 (small_fix, repo-health-code-pilot) carrying the issue's acceptance criteria verbatim. Issue #5673 stays open for task 9770.
123 remaining items
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 6, 2026
Lane B (code-b) claimed task 9770 for issue #5673. Execution-lane assignment returned
opencode(§1b), so this task is handed off to the opencode claimant — checkpointedhanded_offand parked 1200s for the claimant to launch the bound session. Issue verified OPEN with no hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit).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 · picked up
dezren39 commentedon Nov 6, 2026
🤖 Agent note · PR opened