Skip to content

repo-queue(client): a list response over 32 KiB comes back chunked — the client does not de-chunk, parses Null, and silently prints "(no tasks)" for a 178-row queue #7355

Closed

Description

@dezren39

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

Proposed fix

  • Decode Transfer-Encoding: chunked in direct_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 of unwrap_or(Value::Null). A silent empty list is the worst possible outcome for a queue reader.
  • Have poll.py request 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 rule poll.py already applies to the OpenCode session list).
  • Consider making /list always send Content-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 list returns the true rows for a response over 32 KiB (chunked transfer encoding) — e.g. --queue repo-health-code-pilot --status claimed --limit 98 and 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

  1. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor
  2. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/highImportant and time-sensitive
    effort/sSmall: expected under 2 hours of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 8, 2026
  3. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    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/enriched applied.

  4. developing-today commented on Nov 9, 2026

    @developing-today
    Contributor

    🤖 Agent note · handed off

  5. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    and removed on Nov 9, 2026
  6. 31 remaining items

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

    @dezren39
    MemberAuthor

    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 are mcpx-test jobs 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.

  9. added a commit that references this issue on Nov 11, 2026
  10. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    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_passed and re-verified everything fresh on the unchanged head c545f0f: PR MERGEABLE, Codex review completed with no findings, and cargo test -p fleet-queue --all-features re-run on the laptop reproduces the prior result exactly — lib 272 passed, tests/chunked_list.rs 2 passed, broker_bin_args 1 passed, 0 failed. The failing PR checks are mcpx-test jobs in an unrelated subsystem (this diff touches only pkgs/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.

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

    effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivestatus: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