Skip to content

fleet(queue): repo-queue client resolves home-relative paths at the filesystem root when HOME is unset or empty — home() falls back to an empty string #6238

Open

Description

@dezren39

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 payload token_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 a broker.log opened there (silently ignored on failure for unprivileged users; actually created at root when run privileged)
  • :1257-1262 — cmd_signal default 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/user with 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

Acceptance criteria

Activity

  1. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/fleetpkgs/fleet multicall binary + platform crates
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  5. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor

    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 at pkgs/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.

  6. 61 remaining items

  7. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  8. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  9. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 6, 2026
  10. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  11. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 6, 2026
  12. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobstatus/parkedDeliberately paused with a recorded resume conditiontask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions