Resource listing cannot paginate beyond the returned results
Summary
We use Agent Native in a system built around context and skills. The resource listing action cannot paginate through a directory's contents.
When a directory contains more entries than the action returns, the agent receives only part of the listing. There is no way to request the next page through the action.
For example, listing a large skills directory leaves some skills undiscoverable through resource listing.
Environment
- System: Agent Native.
- Affected surface: The resource listing action, including listings of directories containing skills.
Steps and observed behavior
- Use a resource directory containing more entries than a single listing returns.
- Ask the agent to list the resources in that directory.
- Ask it to retrieve the remaining entries.
The initial result contains only part of the directory. The action offers no pagination mechanism, so the agent cannot continue through the remaining entries.
Expected behavior
The resource listing action supports pagination. The agent can request subsequent pages until it has listed all entries in the directory.
Each response indicates whether more results remain and provides the information needed to retrieve the next page.
Impact
Agents cannot reliably discover all available resources in large directories. In a skills directory, this prevents them from finding relevant skills beyond the returned results.
I reproduced this with 300 skills: the agent loses skills 158 to 300
I wrote one test that follows the steps in the issue:
- Add 300 skills for one user:
skills/skill-001/SKILL.mdtoskills/skill-300/SKILL.md. - List them with the agent's
resourcestool:action: "list",prefix: "skills/". - List them again with
limit: "50",offset: "50"andcursor: "2". - Rebuild the chat history with that list in it, the way the app does when it resumes one stopped reply.
What happened:
| Step | Skills the agent gets | Notes |
|---|---|---|
| 2 | 300 of 300 | All in one 22,889-character result. Nothing says there's more. |
| 3 | 300 of 300 | The page settings change nothing. Same result as step 2. |
| 4 | 157 of 300 | History keeps the first 12,000 characters. The list stops partway through skill-157. |

Why:
- The list action has no page option.
packages/core/src/scripts/resources/list.tsaccepts--prefix,--scope,--formatand--include-agent-scratch, and returns the whole folder each time. - Chat history keeps 12,000 characters of each old tool result (
packages/core/src/agent/thread-data-builder.ts:1291). The cut-off note tells the agent to list again. Listing again returns the same long result, so the agent can't get to the missing skills.

Not checked yet:
- Normal follow-up replies. I confirmed the cut when the app resumes one stopped reply (
resumeThreadHistoryForRequest). I haven't traced the normal path. - The first list call. The agent gets all 300 there. I found no limit on that path.
Thanks for the report. resource-list now takes limit and offset, sorts by path, and every response includes the total, whether more results remain, and the next offset, so the agent can page through a whole directory. It's in review now: https://github.com/BuilderIO/agent-native/pull/8581