Repository navigation
Description
fleet(queue): repo-queue client accepts empty REPO_QUEUE_DEFAULT_QUEUE / REPO_QUEUE_SIGNAL_PATH — silently talks to queue "" and fails signal writes with a blank path
Bug
In pkgs/fleet/crates/fleet-queue/src/client.rs (developing-today/code @ 6f5df296e2):
-
default_queue()(client.rs:585-587) returnsstd::env::var("REPO_QUEUE_DEFAULT_QUEUE")verbatim whenever the variable is set, falling back toDEFAULT_QUEUEonly when it is unset:fn default_queue() -> String { std::env::var("REPO_QUEUE_DEFAULT_QUEUE").unwrap_or_else(|_| DEFAULT_QUEUE.to_string()) }
An exported-but-empty value (a common shell/systemd accident:
REPO_QUEUE_DEFAULT_QUEUE=in an env file, an unset variable expanded by a wrapper) therefore becomes the queue name for every verb that goes throughopt_queue()—list,enqueue,claim,signal, etc. -
cmd_signal(client.rs:1257) has the same shape forREPO_QUEUE_SIGNAL_PATH: an empty value becomes the signal file path.
The same file already shows the intended pattern: direct_broker_url() (client.rs:69-76) trims REPO_QUEUE_BROKER_URL and treats empty as unset. The fleet-search client does the same for ATLAS_SEARCH_URL / ATLAS_SEARCH_TOKEN. These two sites were missed.
Evidence (verified this run, laptop primary @ 6f5df296e2; code identical at probe build)
Probe: ~/git/fleet/probe-queue-empty-env (laptop) — real repo-queue binary against a recording loopback stub broker (REPO_QUEUE_BROKER_URL=http://127.0.0.1:<port>, stub token file):
| Case | Request recorded at stub | Client output |
|---|---|---|
REPO_QUEUE_DEFAULT_QUEUE unset (control) |
POST /list {"queue":"repo-health-code-shadow",…} |
(no tasks) |
REPO_QUEUE_DEFAULT_QUEUE= (empty) |
POST /list {"queue":"",…} |
(no tasks) — no error, no warning |
REPO_QUEUE_DEFAULT_QUEUE=" " (whitespace) |
POST /list {"queue":" ",…} |
(no tasks) — no error, no warning |
REPO_QUEUE_SIGNAL_PATH= (empty), signal --reason probe |
/signal-count posted normally |
exit 3, stderr: repo-queue: cannot write : No such file or directory (os error 2) — blank path in the message, signal file never written |
So with an empty default-queue variable, an operator (or a fleet script) is silently shown an empty queue that is not the real queue, and an enqueue would be addressed to queue "" instead of the pilot queue — work addressed somewhere no worker claims, with no error anywhere. With an empty signal path, the wake-up signal that follows an enqueue dies with a message that names no path, so the failure is hard to trace back to the variable.
Why it matters
The repo-queue client is the fleet's control plane (producers enqueue, workers claim, signals wake workers). Its failure mode for a plausible configuration accident should be a loud usage error or the documented default — never silent redirection to a nonexistent queue. This is the same silent-misdirection class as #5939 (client parser silently overwriting/misreading flags, fixed) and the HOME-fallback filings #6238/#5640, but a distinct site and mechanism (env-var empty acceptance), not covered by either.
Acceptance criteria
-
REPO_QUEUE_DEFAULT_QUEUEset to empty or whitespace-only is treated as unset (fall back toDEFAULT_QUEUE), or rejected with a usage error naming the variable and its value — matching thedirect_broker_url()trim-and-ignore-empty precedent in the same file; the chosen behavior is pinned by a test. -
REPO_QUEUE_SIGNAL_PATHset to empty or whitespace-only gets the same treatment (default path or a named usage error); a signal write failure never reports a blank path. - Tests pin: unset → default; empty → default/error; whitespace → default/error; a normal value is used verbatim (trimmed per the broker-URL precedent).
- Audit the client's remaining env reads (
REPO_QUEUE_TOKEN_FILE,REPO_QUEUE_BROKER_URL— the latter already guards empty) for the same acceptance and note the result on this issue. - No behavior change when the variables are unset or set to ordinary values:
listagainst the stub broker sends the same queue name as before.
Related
- fleet(queue): repo-queue client parser silently overwrites duplicate flags, accepts --dry-run=false as true, and silently defaults a non-numeric --limit #5939 — repo-queue client parser flag handling (fixed; same silent-misdirection class, different input surface)
- 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 — repo-queue client
home()HOME-unset fallback (different variable, different mechanism) - atlas-search(fleet-search): HOME unset/empty resolves state/config/token paths relative to the CWD (literal ~ dir) #5640 — fleet-search/atlas HOME fallback sites
Activity
developing-today commentedon Nov 5, 2026
🤖 Agent note · filed
new-issue-creator-code-a)new-issue-creator-code-a, run 2026-11-05 10:05 CST6f5df296e2with the realrepo-queuebinary against a recording loopback stub broker (probe~/git/fleet/probe-queue-empty-env): empty/whitespaceREPO_QUEUE_DEFAULT_QUEUEis sent verbatim asqueue:""/queue:" "while the client reports(no tasks); emptyREPO_QUEUE_SIGNAL_PATHmakessignalexit 3 withcannot write : No such file or directory. Dedup: title/keyword searches for both variable names, "default_queue empty", "empty queue name" (open + closed) returned no covering issue; distinct from fleet(queue): repo-queue client parser silently overwrites duplicate flags, accepts --dry-run=false as true, and silently defaults a non-numeric --limit #5939 (CLI flag parser), 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 (HOME fallback), atlas-search(fleet-search): HOME unset/empty resolves state/config/token paths relative to the CWD (literal ~ dir) #5640. Filed via the developing.today GitHub App (fleet_paperwork, verified by readback) because the user token is GraphQL rate-limited this run.direct_broker_url()precedent in the same file, or a named usage error), then a small fix with pinning tests.repo-health-code-pilot(task id in the creator backlog entry); body filehidden_files/issue-fleet-queue-empty-env.mdin the goal workspace.developing-today commentedon Nov 5, 2026
🤖 Agent note · triaged — task 10612 (queue repo-health-code-pilot, lane code-h)
c0b4ac62d1642826ba0b6681d394ba44667ea315(fresh read ofpkgs/fleet/crates/fleet-queue/src/client.rson the laptop primary this triage; line numbers match the issue's exactly):default_queue()(client.rs:585–587): returnsstd::env::var("REPO_QUEUE_DEFAULT_QUEUE")verbatim whenever set — no trim, no empty check — so empty/whitespace becomes the queue name for every verb throughopt_queue().cmd_signal(client.rs:1257): same shape forREPO_QUEUE_SIGNAL_PATH; an empty value becomes the signal file path and the write fails naming a blank path.direct_broker_url()(client.rs:69–76) trimsREPO_QUEUE_BROKER_URLand treats empty as unset — the pattern these two sites missed.client.rsreads exactly five env vars.HOME(client.rs:32,home()) is the distinct 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 mechanism.REPO_QUEUE_BROKER_URL(client.rs:70) is already guarded.REPO_QUEUE_TOKEN_FILE(client.rs:94–95) has the SAME defect: it is used verbatim when set, so an empty value becomestoken_file = ""and the read indirect_roundtripfails withcannot read queue-broker token file : …— a blank path in the message and no fallback to the default token path. It is included in the follow-up fix scope. (Env reads inqueue_broker.rs/secrets_broker.rsare separate server components, outside this issue's client scope — noted only.)repo-health:v1:fix:developing-today/code:issue:6314): apply the trim-and-treat-empty-as-unset pattern at all three sites, tests pinning unset/empty/whitespace/normal for each. Oracle: thedirect_broker_url()precedent + the stub-broker invariant — empty/whitespace must behave exactly like unset.9 remaining items
dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
Merge pull request #6355 from developing-today/queue/10676-6314-repo-…
dezren39 commentedon Nov 5, 2026
🤖 Agent note · done
load_token_file), opened PR fix(fleet-queue): treat empty/whitespace queue env vars as unset (#6314) #6355, and merged it.