-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(providers): give Z.AI its real discovery endpoint and response shape #4886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,10 @@ export interface ProviderModelDiscoveryFilter { | |
| interface ProviderModelDiscoverySharedSpec { | ||
| /** Query parameters applied to the resolved discovery URL. */ | ||
| query?: Readonly<Record<string, string>>; | ||
| /** Top-level response key containing model rows; defaults to `data`. */ | ||
| envelopeKey?: string; | ||
| /** Model-row field containing the provider-native identifier; defaults to `id`. */ | ||
| idField?: string; | ||
|
Comment on lines
+67
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Include Useful? React with 👍 / 👎. |
||
| /** Declarative eligibility rules evaluated against each untrusted model row. */ | ||
| filter?: ProviderModelDiscoveryFilter; | ||
| /** Optional lower byte ceiling; the process-wide hard ceiling still wins. */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Route this declared response shape through
extractProviderModelItemsin the management connection-test path. That path currently invokes the shared parser only for arrays orrecord.data; a Z.AIrecord.modelsresponse instead falls through toextractModelEnvelopeRows, which merely counts rows and never validates the declaredslugidentifier or applies discovery filters. Consequently a response such as{"models":[{}]}is reported as “Connected — 1 model available” even though catalog discovery rejects the same response asinvalid_shape.Useful? React with 👍 / 👎.