Skip to content

[MEDIUM] 14+ list endpoints without pagination; dual error format; list wrapping inconsistency #78

Description

@physercoe

Summary

Three API consistency issues:

1. 14+ list endpoints without LIMIT/pagination

Endpoint Risk
handleListProjects Returns ALL projects
handleListAgents Returns ALL agents — potentially thousands
handleListHosts Returns ALL hosts
handleListRuns Returns ALL runs
handleListDeliverables No LIMIT
handleListChannels No LIMIT
handleListSchedules No LIMIT
handleListTemplates No LIMIT
handleListCommands No LIMIT
+ admin variants

None support cursor/offset-based pagination. On large teams, responses can be massive.

2. Dual error response format

  • writeErr produces {"error":"..."} (standard, used everywhere)
  • writeProblem in handlers_phase.go:456 produces RFC 9457: {"type":"about:blank","title":"...","status":409,"code":"...","detail":"..."} with Content-Type: application/problem+json

Two error shapes, two Content-Types, same API.

3. List wrapping inconsistency

  • Most list endpoints return bare [...]
  • handleListDeliverables returns {"items": [...]}
  • handleAdminListAgents returns {"agents": [...]}
  • handleAdminListAudit returns {"events": [...]}
  • handleListAudit returns bare [...] (same data, different contract!)

A client cannot predict the JSON shape of a list endpoint response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions