Paginate the model-provider-service listing, and resolve by name as a fallback - #264
Merged
Conversation
`main.tien_le.openai_all` exists — the UC explore page shows it, and a direct GET
returns HTTP 200 — but ucode reported:
Model provider service 'main.tien_le.openai_all' was not found.
`resolve_provider_service` lists and filters in memory, and the listing made a
single unpaginated request. That metastore has 30 services across 2 pages, so
ucode saw an arbitrary 16 and discarded the `next_page_token`. Anything on a later
page was invisible — to the resolver and to the interactive picker alike.
- `list_model_provider_services` now pages, mirroring `list_model_services` right
above it (bounded `page_size`, `next_page_token`, a `seen_tokens` guard against a
server echoing one back). A mid-pagination failure degrades to partial results
rather than an error, since partial data is more useful than none.
- It also accepts `parent` to scope the listing to one `catalog.schema`. The
metastore-wide default is documented in the proto as an internal scope that is
"likely to be deprecated", so callers that know the schema should pass it.
- `get_model_provider_service` addresses a service by name, and
`resolve_provider_service` falls back to it before concluding "not found" — a
named service should never be judged absent on the strength of a listing that
might be incomplete.
- The entry-parsing moves to `_provider_service_entry`, shared by both paths.
Verified against eng-ml-inference.staging: the listing goes from 16 to 30 services,
`main.tien_le.openai_all` appears, `parent="main.tien_le"` returns exactly the
three services in that schema, and resolving a genuinely absent name still errors.
Tests: +8. `test_follows_next_page_token` was checked against the old single-page
behavior, where it fails with "Right contains one more item: 'main.s.two'" — the
same page-2 loss that caused the report.
Co-authored-by: Isaac
tt-le
force-pushed
the
tien/mps-listing-pagination
branch
from
August 5, 2026 18:02
ab8c692 to
85b9768
Compare
andy-xu-db
self-requested a review
August 5, 2026 18:36
andy-xu-db
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
main.tien_le.openai_allexists — the UC explore page shows it, and a direct GET returns HTTP 200 — butucode configurereported:resolve_provider_servicelists the workspace's provider services and filters in memory, andlist_model_provider_servicesmade a single unpaginated request, discardingnext_page_token. The metastore in question has 30 services across 2 pages, so ucode saw an arbitrary 16 of them. Anything on a later page was invisible — to the resolver, and to the interactive "Select a model provider service" picker.Changes
list_model_provider_servicespaginates, mirroringlist_model_servicesdirectly above it: boundedpage_size, followsnext_page_token, and aseen_tokensguard in case a server echoes one back. A mid-pagination failure degrades to partial results rather than an error, since partial data beats none.parentto scope the listing to onecatalog.schema. The proto notes the metastore-wide default is an internal scope that is "likely to be deprecated", so callers that know the schema should pass it. The picker still needs the broad list, so that path keeps the metastore scope — now paginated.get_model_provider_servicefetches one service by name, andresolve_provider_servicefalls back to it before concluding "not found". A named service shouldn't be judged absent on the strength of a listing that might be incomplete; only a 404 there means it really is. The list stays first, because the picker needs to enumerate and the "Available for<tool>: ..." hint is built from it._provider_service_entry, shared by both paths.Test plan
parentscoping,page_sizealways being sent, and the by-name GET (success + 404).test_follows_next_page_tokenwas checked against the old single-page behavior, where it fails withRight contains one more item: 'main.s.two'— the same page-2 loss that caused the report, rather than merely asserting the new code's output.eng-ml-inference.staging: the listing goes from 16 to 30 services;main.tien_le.openai_allnow appears;parent="main.tien_le"returns exactly the three services in that schema; resolving a genuinely absent name still errors with the available-names hint.test_e2e_user_agent.py::test_user_agent_arrives_at_gateway, which fails identically on unmodifiedmain(it needs a live gateway).This pull request and its description were written by Isaac.