Skip to content

fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads #6404

Closed

Description

@dezren39

fleet-config: a relative HOME is used verbatim — config, state, and broker socket resolve CWD-relative and a planted fleet.toml loads

Summary

fleet-config filters an empty HOME (it falls back to ".", tracked separately as #5737) and treats empty or relative XDG bases as the hazards they are (#5473 closed; #6396 open for relative XDG), but a non-empty relative HOME is used verbatim as the anchor for every home-relative resolution in the crate. With HOME=relhome, Config::file_path() returns the relative path relhome/.config/fleet/fleet.toml, and Config::load() loads a fleet.toml planted under the process's current working directory. The state dir, the shims dir under it, the broker socket, and both token-file paths resolve CWD-relative the same way.

This is a distinct trigger from the filed siblings: #5737 covers HOME unset/empty (the "." fallback); #6396 covers relative XDG bases with HOME present and correct (and explicitly puts the HOME cases out of its scope). Neither covers HOME itself being set to a relative path.

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:225-227 — home_dir(): env_path("HOME").unwrap_or_else(|| PathBuf::from(".")). env_path/non_empty_path (:217-223) filter only the empty case; a relative value passes through unchanged.
  • pkgs/fleet/crates/fleet-config/src/lib.rs:252-263 — file_path_from joins .config/fleet/fleet.toml onto that home value; a relative home stays relative.
  • pkgs/fleet/crates/fleet-config/src/lib.rs:442-445 — state_dir_from joins .local/state/fleet onto the same home; shims_dir() is state_dir()/shims.
  • pkgs/fleet/crates/fleet-config/src/lib.rs:302-320 — broker_socket_from resolves the default .cache/laptop-agent/broker.sock under the same home via resolve_under; default_token_file() (:385) and secrets_token_file() (:430) resolve under it too.

Verification (this run, laptop, real fleet-config crate)

Probe ~/git/fleet/probe-fleet-config-empty-rel (path-depends on the real fleet-config crate; paths bin prints file_path/state_dir, loads via Config::load(), and reports domain flags):

  • From a scratch CWD containing a planted relhome/.config/fleet/fleet.toml ([domains] planted = false), with HOME=relhome and XDG/FLEET_CONFIG unset:
    • file_path=relhome/.config/fleet/fleet.toml (relative)
    • state_dir=relhome/.local/state/fleet
    • broker_socket=relhome/.cache/laptop-agent/broker.sock
    • planted_enabled=false — the planted CWD config was loaded (an unknown domain defaults to enabled; false can only come from the planted file)
    • queue_enabled=true (control domain untouched)
  • Same relative HOME=relhome from a CWD with no relhome tree: planted_enabled=true — defaults rule; the load follows the CWD-relative path, not any fixed location.
  • Control, absolute HOME=<scratch>/abshome: all paths anchor at the absolute home; its own config loads as expected.

Why it matters

Acceptance criteria

Activity

  1. 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)
    on Nov 6, 2026
  2. developing-today commented on Nov 6, 2026

    @developing-today
    Contributor
  3. added
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 6, 2026
  4. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 6, 2026
  6. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. 4 remaining items

  8. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 6, 2026
  9. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  10. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions