Skip to content

Conversation

@angelahning
Copy link
Collaborator

The UI queries the providers for the list of supported models, instead of using our hard-coded lists.

fixes #3645

Screen.Recording.2025-08-17.at.10.44.26.PM.mov

@angelahning angelahning marked this pull request as ready for review August 22, 2025 01:16
@angelahning angelahning requested a review from zanesq August 22, 2025 01:16
Copy link
Collaborator

@zanesq zanesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice works well!

Couple of nits:

  1. maybe we want to add type to search also to provider dropdown label to be consistent?
image
  1. Currently, 500 is always returned if the provider fails, even for known/expected failures (e.g., invalid API key). Can we distinguish between transient errors and permanent misconfigurations?

Signed-off-by: Angela Ning <aning@squareup.com>
Signed-off-by: Angela Ning <aning@squareup.com>
@angelahning angelahning merged commit 9fe20f9 into main Aug 25, 2025
11 checks passed
@angelahning angelahning deleted the aning/ui2 branch August 25, 2025 17:18
Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for getting this in, but I think we can tighten up the code a bit more here

'X-Secret-Key': await window.electron.getSecretKey(),
},
});
return response.data || [];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should use the generated API. you should never have to call getSecretKey

};
}
});
const results = await Promise.all(modelPromises);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem ideal; if we wanted to get all the models for all the providers, we should just make that a flag on the getProviders method; the server can do that much more efficient.

but really, since we already split this up into selecting a provider first and then list the models, why not call this just in time? we have 28 providers, so that would avoid this mini DOS attack on our server.

if (error) {
errors.push(error);
// Fallback to metadata known_models on error
if (p.metadata.known_models && p.metadata.known_models.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have this fall back twice? also I don't think known_models is optional here, so we shouldn't need to check all this

// Log errors if any providers failed (don't show to user)
if (errors.length > 0) {
console.error('Provider model fetch errors:', errors);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have this complex machinery to keep track of the errors, only to log them here and then do nothing about them?

}
} else if (models && models.length > 0) {
groupedOptions.push({
options: models.map((m) => ({ value: m, label: m, provider: p.name })),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dupe from 176

shellz-n-stuff pushed a commit to shellz-n-stuff/goose that referenced this pull request Aug 27, 2025
Signed-off-by: Angela Ning <aning@squareup.com>
Signed-off-by: Alex Rosenzweig <arosenzweig@squareup.com>
dorien-koelemeijer pushed a commit to dorien-koelemeijer/goose that referenced this pull request Sep 2, 2025
Signed-off-by: Angela Ning <aning@squareup.com>
Signed-off-by: Dorien Koelemeijer <dkoelemeijer@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In the UI we dont seem to load the actual models

4 participants