Repository navigation
Description
Symptom
repo-queue list silently reports an empty queue when its response exceeds 32 KiB, with exit code 0:
$ repo-queue list --queue repo-health-code-pilot --status claimed --limit 97 | tail -n +3 | grep -c '^task '
97
$ repo-queue list --queue repo-health-code-pilot --status claimed --limit 98
(no tasks)
$ echo $?
0
The same queue holds 178 claimed rows at the time of writing (verified by talking to the broker directly). The threshold is not the row count, it is the byte size of the response: the largest plain-bodied reply I could get was 32 602 bytes (--limit 97, non-rich); every reply from 33 053 bytes up came back chunked.
/health is unaffected for the same queue, and --limit up to the 500 maximum is accepted without complaint.
Cause
pkgs/fleet/crates/fleet-queue/src/queue_broker.rs serves /list through tiny_http, which switches from Content-Length to Transfer-Encoding: chunked once the body passes ~32 KiB:
HTTP/1.1 200 OK | Content-Length: 32602 # --limit 97
HTTP/1.1 200 OK | Transfer-Encoding: chunked # --limit 98
The client's direct-broker transport (pkgs/fleet/crates/fleet-queue/src/client.rs:120-130) reads to EOF and then does:
let split = raw.windows(4).position(|w| w == b"\r\n\r\n")...;
let resp_body: Value = serde_json::from_slice(&raw[split + 4..]).unwrap_or(Value::Null);It never de-chunks. So serde_json sees 2000\r\n{"ok":true,... and fails; unwrap_or(Value::Null) turns that failure into Null; cmd_list (client.rs:1121-1129) does resp.get("rows")...unwrap_or_default() → empty vec → prints (no tasks) and returns 0.
Nothing logs, warns or exits non-zero: a truncated/chunked read is indistinguishable from an empty queue.
Impact
- Any queue large enough to exceed 32 KiB per page reads as empty. For
repo-health-code-pilotthat is--limit≥ 98 withrich, or ≥ 98 without. Raising the limit to see more rows makes the result worse: exactly the pages that would carry the census return nothing. - This is a second, independent cause of the
poll.pyblindness in opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325. Even after opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325 giveslista JSON mode andfetch_claimed_rows()parses it, a--limitthat makes the response large enough will still yield zero rows — and opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325's proposed fix is to raise the limit. - Independent truncation in
poll.pytoday:fetch_claimed_rows()passes no--limit, and the CLI/broker default is 20 (LIST_LIMIT_DEFAULT).repo-health-code-pilotholds 158 claimedopencode-lane rows; only the first 20 by(priority, created_at)are ever read, so ahanded_offcandidate sorting past row 20 is invisible no matter what the JSON mode does.
Proposed fix
- Decode
Transfer-Encoding: chunkedindirect_roundtrip(and any other hand-rolled HTTP parse in this client), and fail closed — non-zero exit with a message — when a 200 body cannot be parsed, instead ofunwrap_or(Value::Null). A silent empty list is the worst possible outcome for a queue reader. - Have
poll.pyrequest an explicit high--limit(500) so a large claimed set is read whole, and treat "row count == requested limit" as possibly-truncated rather than proven complete (the same escalating-limit rulepoll.pyalready applies to the OpenCode session list). - Consider making
/listalways sendContent-Length, since the broker materialises the whole body anyway.
Verification
$ python3 - <<'PY' # direct broker read, de-chunked
# limit=98 -> 98 rows; limit=500 -> 189 rows
PY
$ repo-queue list --queue repo-health-code-pilot --status claimed --limit 200 | tail -n +3 | grep -c '^task '
# expected: 178 (currently 0)
Related: #7325 (poll.py table-vs-JSON, the first cause of the same blindness), #7349 (list/health reject --worker), #6865 (claimant.py imports), #3026 (slice 1).
Acceptance criteria
repo-queue listreturns the true rows for a response over 32 KiB (chunked transfer encoding) — e.g.--queue repo-health-code-pilot --status claimed --limit 98and above print the claimed rows instead of(no tasks), with the row count matching a direct broker read.- A malformed or unparseable response can never print
(no tasks)with exit code 0: parse failure is a loud non-zero error. - A regression test covers a >32 KiB list response end to end.
Activity
developing-today commentedon Nov 8, 2026
CODE-2264
dezren39 commentedon Nov 8, 2026
Intake review
Related: #7375 / #7325 (the claimant's table-vs-JSON blindness — the other silent-empty failure on the same verb); seam-contract design #7770 (verified reads).
Live check: filer's threshold repro today is exact (97 rows OK at 32 602 bytes, 98 rows chunked and empty at 33 053 bytes, against 178 real claimed rows read via the broker directly); no merged fix in this run's scan.
Notes / risks: silent-empty with exit 0 is the worst failure shape for a queue client — every consumer's 'nothing to do' path lights up. The chunked switch is in the broker's tiny_http serving, but the client's failure to de-chunk (and then to parse Null as empty) is where the silence is manufactured; the fixing PR should say which side it changes and why.
Suggested approach: de-chunk in the client (or read via a client that handles chunked encoding), treat unparseable bodies as errors, and add the size-threshold regression test.
— fleet monitor (repo-fleet-monitor), 2026-11-08 12:12 CST run: acceptance criteria appended to the body, labels normalized,
meta/enrichedapplied.developing-today commentedon Nov 9, 2026
🤖 Agent note · handed off
opencode31 remaining items
dezren39 commentedon Nov 11, 2026
state: in-progress (lane code-c, task 14999, resumed at targeted_tests_passed)
Resuming the revived task (from task 14322) at its checkpoint: PR #8744, head c545f0f, is the artifact; the remaining steps were CI disposition and the merge decision.
Re-verified fresh this shift: PR #8744 OPEN and MERGEABLE at head c545f0f (unchanged); Codex review on that head completed with no findings; the diff touches only
pkgs/fleet/crates/fleet-queue(client.rs,Cargo.toml,tests/chunked_list.rs). The failing PR checks aremcpx-testjobs in an unrelated subsystem (the diff cannot affect them); the remaining checks are pending in the fleet-wide Actions runner stall. Re-running the targeted suite on the PR head now (cargo test -p fleet-queue --all-features) to confirm the prior lane's 272-pass result before merging under the standing criteria.Merge pull request #8744 from developing-today/fix/7355-chunked-list
dezren39 commentedon Nov 11, 2026
state: done (lane code-c, task 14999, fixed_merged)
PR #8744 merged 2026-11-11T18:49:14Z, merge commit 9426c04; issue #7355 closed.
Resumed from task 14322's checkpoint at
targeted_tests_passedand re-verified everything fresh on the unchanged head c545f0f: PR MERGEABLE, Codex review completed with no findings, andcargo test -p fleet-queue --all-featuresre-run on the laptop reproduces the prior result exactly — lib 272 passed,tests/chunked_list.rs2 passed, broker_bin_args 1 passed, 0 failed. The failing PR checks aremcpx-testjobs in an unrelated subsystem (this diff touches onlypkgs/fleet/crates/fleet-queue); the remaining checks were pending in the fleet-wide Actions runner stall. Merged under the standing criteria. Task 14999 completed in the fleet queue with outcome fixed_merged.