Title: 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 · Issue #7355 · developing-today/code · GitHub
Open Graph Title: 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 · Issue #7355 · developing-today/code
X Title: 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 · Issue #7355 · developing-today/code
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...
Open Graph 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...
X 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...
Opengraph URL: https://github.com/developing-today/code/issues/7355
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"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","articleBody":"## Symptom\n\n`repo-queue list` silently reports an **empty queue** when its response exceeds 32 KiB, with exit code 0:\n\n```\n$ repo-queue list --queue repo-health-code-pilot --status claimed --limit 97 | tail -n +3 | grep -c '^task '\n97\n$ repo-queue list --queue repo-health-code-pilot --status claimed --limit 98\n(no tasks)\n$ echo $?\n0\n```\n\nThe 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.\n\n`/health` is unaffected for the same queue, and `--limit` up to the 500 maximum is accepted without complaint.\n\n## Cause\n\n`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:\n\n```\nHTTP/1.1 200 OK | Content-Length: 32602 # --limit 97\nHTTP/1.1 200 OK | Transfer-Encoding: chunked # --limit 98\n```\n\nThe client's direct-broker transport (`pkgs/fleet/crates/fleet-queue/src/client.rs:120-130`) reads to EOF and then does:\n\n```rust\nlet split = raw.windows(4).position(|w| w == b\"\\r\\n\\r\\n\")...;\nlet resp_body: Value = serde_json::from_slice(&raw[split + 4..]).unwrap_or(Value::Null);\n```\n\nIt 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.\n\nNothing logs, warns or exits non-zero: a truncated/chunked read is indistinguishable from an empty queue.\n\n## Impact\n\n- **Any queue large enough to exceed 32 KiB per page reads as empty.** For `repo-health-code-pilot` that is `--limit` ≥ 98 with `rich`, or ≥ 98 without. Raising the limit to see more rows makes the result *worse*: exactly the pages that would carry the census return nothing.\n- **This is a second, independent cause of the `poll.py` blindness in #7325.** Even after #7325 gives `list` a JSON mode and `fetch_claimed_rows()` parses it, a `--limit` that makes the response large enough will still yield zero rows — and #7325's proposed fix is to raise the limit.\n- **Independent truncation in `poll.py` today:** `fetch_claimed_rows()` passes no `--limit`, and the CLI/broker default is 20 (`LIST_LIMIT_DEFAULT`). `repo-health-code-pilot` holds 158 claimed `opencode`-lane rows; only the first 20 by `(priority, created_at)` are ever read, so a `handed_off` candidate sorting past row 20 is invisible no matter what the JSON mode does.\n\n## Proposed fix\n\n- 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.\n- 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).\n- Consider making `/list` always send `Content-Length`, since the broker materialises the whole body anyway.\n\n## Verification\n\n```\n$ python3 - \u003c\u003c'PY' # direct broker read, de-chunked\n# limit=98 -> 98 rows; limit=500 -> 189 rows\nPY\n$ repo-queue list --queue repo-health-code-pilot --status claimed --limit 200 | tail -n +3 | grep -c '^task '\n# expected: 178 (currently 0)\n```\n\nRelated: #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).\n\n## Acceptance criteria\n\n- `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.\n- A malformed or unparseable response can never print `(no tasks)` with exit code 0: parse failure is a loud non-zero error.\n- A regression test covers a >32 KiB list response end to end.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-08T06:36:45Z","url":"https://github.com/developing-today/code/issues/7355"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5fc20969-4a37-6fc1-23f7-1973f89054bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B824:3CDC55:3AF026:4D96F3:6B0633F4 |
| html-safe-nonce | 2f75d16cdd699184e8db6b62c7f58e216b1794856aeafdd183d60bac6936f052 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODI0OjNDREM1NTozQUYwMjY6NEQ5NkYzOjZCMDYzM0Y0IiwidmlzaXRvcl9pZCI6IjI3NTA0MDk2NjQxNTk0Mjk2MjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c127145ab08c8c84a5a24671827161f7d2576a6a9a91fdef5af78e2e51636fd5 |
| hovercard-subject-tag | issue:6268390084 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/7355/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bc23abddc7af70bbc9ece1c4190c66f5f6b671b96f273e3a076e71048f30ff0b/developing-today/code/issues/7355 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bc23abddc7af70bbc9ece1c4190c66f5f6b671b96f273e3a076e71048f30ff0b/developing-today/code/issues/7355 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9eb3bb1597d09170a5f282cd38ae376dee1a5ec1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width