fix: prevent crash when invalid OpenAPI spec is loaded for tool servers (#20257)

* enh

* fix
This commit is contained in:
Classic298 authored and GitHub committed 2025-12-30 18:02:56 +04:00
1 parent 935808f5ea
commit 697e94e935
2 files changed
+20 -8

No files matched your search

+8 -1
View File
@@ -379,6 +379,13 @@ export const getToolServersData = async (servers: object[]) => {
}
if (res) {
if (!res.paths) {
return {
error: 'Invalid OpenAPI spec',
url: server?.url
};
}
const { openapi, info, specs } = {
openapi: res,
info: res.info,
@@ -1667,7 +1674,7 @@ export interface ModelMeta {
profile_image_url?: string;
}
export interface ModelParams {}
export interface ModelParams { }
export type GlobalModelConfig = ModelConfig[];