fix(issues): gitea_issue_list silently hides everything past 20 rows #2

Closed
opened 2026-10-23 17:17:52 +00:00 by dsh · 1 comment
Owner

Symptom

gitea_issue_list never returns more than 20 rows, whatever limit is passed. pvlb-infra/vps-setup has 28 issues (state=all); the tool shows 20 and the model has no idea the rest exist.

Reproduced 2026-10-23:

call tool output direct REST API
limit:50, page:1 20 rows 28 rows
limit:100, page:1 20 rows 28 rows
limit:50, page:2 OK (empty) 0 rows (offset 50 — correct)
limit:20, page:2 8 rows 8 rows

Root cause

The request is fine; the formatter cuts the response:

// lib/handlers/formatters.js:205
const lines = data.slice(0, 20).map((item) => { ... })

The tool result the model sees is built from this text, so 8 issues vanish even though wrap() returned them.

Fix

Render every row the API returned (the page size is already controlled by the caller's limit/page), or cap deliberately at 100 with an explicit footer such as … and 8 more — call again with page: 2. Silent truncation is the bug; a visible truncation would be acceptable.

Acceptance

  • 28 issues + limit:50 → all 28 rows (or 20 + "8 more" footer).
  • limit:5 still returns exactly 5.
  • The formatter never drops rows without saying so.
## Symptom `gitea_issue_list` never returns more than **20 rows**, whatever `limit` is passed. `pvlb-infra/vps-setup` has 28 issues (`state=all`); the tool shows 20 and the model has no idea the rest exist. Reproduced 2026-10-23: | call | tool output | direct REST API | |---|---|---| | `limit:50, page:1` | 20 rows | 28 rows | | `limit:100, page:1` | 20 rows | 28 rows | | `limit:50, page:2` | `OK` (empty) | 0 rows (offset 50 — correct) | | `limit:20, page:2` | 8 rows | 8 rows | ## Root cause The request is fine; the **formatter** cuts the response: ```js // lib/handlers/formatters.js:205 const lines = data.slice(0, 20).map((item) => { ... }) ``` The tool result the model sees is built from this text, so 8 issues vanish even though `wrap()` returned them. ## Fix Render every row the API returned (the page size is already controlled by the caller's `limit`/`page`), or cap deliberately at 100 with an **explicit** footer such as `… and 8 more — call again with page: 2`. Silent truncation is the bug; a visible truncation would be acceptable. ## Acceptance - [ ] 28 issues + `limit:50` → all 28 rows (or 20 + "8 more" footer). - [ ] `limit:5` still returns exactly 5. - [ ] The formatter never drops rows without saying so.
dsh closed this issue 2026-10-23 18:05:32 +00:00
Author
Owner

Fixed in 4d77e9f (fix(tools): render complete lists and never print a bare OK), merged to master (#11).

  • The formatter no longer slices to 20: it renders every row up to 100 and adds an explicit footer beyond that (… and N more — narrow the filter or page through.).
  • Live check (Forgejo 17, running plugin): gitea_issue_list on pvlb-infra/vps-setup (state=all, limit=50, page=1) returned all 28 rows; limit:5 still returns exactly 5 (covered by test/handlers-formatters.test.mjs).
Fixed in 4d77e9f (`fix(tools): render complete lists and never print a bare OK`), merged to `master` (#11). - The formatter no longer slices to 20: it renders every row up to 100 and adds an explicit footer beyond that (`… and N more — narrow the filter or page through.`). - Live check (Forgejo 17, running plugin): `gitea_issue_list` on `pvlb-infra/vps-setup` (`state=all`, `limit=50`, `page=1`) returned all **28** rows; `limit:5` still returns exactly 5 (covered by `test/handlers-formatters.test.mjs`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
dsh-plugins/dsh-gitea#2
No description provided.