Description
The /models command and background catalog refresh issue a single GET /v1/models request without handling OpenAI-style cursor pagination (has_more / after), so only the first page of results is returned. When a provider has more models than the default page size, most models are silently dropped.
Steps to reproduce
- Configure a provider with a large model roster (e.g. OpenCode Go)
- Run
/models or codewhale models
- Observe that the returned list is much shorter than the provider actually offers
Expected behavior
All available models from the provider are listed.
Actual behavior
Only the first page (~10–20 models) is returned; remaining models are missing.
Impact
Always happens for providers whose model count exceeds one page. Most models are unavailable for selection.
Environment
- OS: Windows 11
- codewhale version: 0.9.13
- Install method: source build
- Model/provider: OpenCode Go (and any provider with > default page size)
- Terminal app: Windows Terminal
- Shell: PowerShell
Logs, screenshots, or recordings
Relevant code in crates/tui/src/client.rs:
ModelsListResponse struct (~line 3319) only has a data field — missing has_more and last_id
list_models() (~line 2432) and fetch_catalog_delta() (~line 2514) both issue a single request with no pagination loop
OpenAI /v1/models paginated response shape:
{
"object": "list",
"data": [...],
"has_more": true,
"last_id": "model-xxx"
}
When has_more is true, the client must request the next page with ?after=<last_id> until has_more becomes false.
Description
The
/modelscommand and background catalog refresh issue a singleGET /v1/modelsrequest without handling OpenAI-style cursor pagination (has_more/after), so only the first page of results is returned. When a provider has more models than the default page size, most models are silently dropped.Steps to reproduce
/modelsorcodewhale modelsExpected behavior
All available models from the provider are listed.
Actual behavior
Only the first page (~10–20 models) is returned; remaining models are missing.
Impact
Always happens for providers whose model count exceeds one page. Most models are unavailable for selection.
Environment
Logs, screenshots, or recordings
Relevant code in
crates/tui/src/client.rs:ModelsListResponsestruct (~line 3319) only has adatafield — missinghas_moreandlast_idlist_models()(~line 2432) andfetch_catalog_delta()(~line 2514) both issue a single request with no pagination loopOpenAI
/v1/modelspaginated response shape:{ "object": "list", "data": [...], "has_more": true, "last_id": "model-xxx" }When
has_moreistrue, the client must request the next page with?after=<last_id>untilhas_morebecomesfalse.