Skip to content

library: presets membership routing is capped at 100 presets per agent (PRESETS_PAGE_SIZE) #13633

Description

@Pwuts

Follow-up from #13594.

The library agent view resolves what a Triggers-tab selection is (trigger agent vs webhook-trigger preset) by membership in the presets list, which is fetched as a single page capped at PRESETS_PAGE_SIZE = 100 (frontend/.../NewAgentLibraryView/hooks/useAgentPresetsQuery.ts).

For agents with more than 100 presets, presetsComplete turns false and unknown IDs fall back to a by-ID preset fetch (fails fast into a graceful not-found card), which degrades the "resolve type before mount" guarantee and costs one throwaway request per stale/unknown selection.

Options:

  • Unpaginate GET /api/library/presets for the graph_id-scoped case (note: the endpoint also backs the copilot list_presets tool via DatabaseManager RPC and the external API surface with a paginated response model, so this is a breaking-ish change needing coordination), or
  • Paginate the frontend membership check (fetch all pages), or
  • Keep the documented fallback if >100 presets per agent remains a non-case in practice.

Low priority: >100 presets on a single agent is an edge case today, and the current behavior degrades gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions