-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
⏲️ feat: Defer Loading MCP Tools #11270
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
7d7b2b5
a883aca
7416d73
302f11d
b8c620b
b791f5f
ff33a92
0f6e3a7
b56fa70
4e12936
8bbdad5
9e7eb28
4212910
b3ba952
5c6ee38
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ import { | |||||
| import { createProviderOption, getDefaultAgentFormValues } from '~/utils'; | ||||||
| import { useResourcePermissions } from '~/hooks/useResourcePermissions'; | ||||||
| import { useSelectAgent, useLocalize, useAuthContext } from '~/hooks'; | ||||||
| import type { TranslationKeys } from '~/hooks/useLocalize'; | ||||||
| import { useAgentPanelContext } from '~/Providers/AgentPanelContext'; | ||||||
| import AgentPanelSkeleton from './AgentPanelSkeleton'; | ||||||
| import AdvancedPanel from './Advanced/AdvancedPanel'; | ||||||
|
|
@@ -36,8 +37,8 @@ import ModelPanel from './ModelPanel'; | |||||
| function getUpdateToastMessage( | ||||||
| noVersionChange: boolean, | ||||||
| avatarActionState: AgentForm['avatar_action'], | ||||||
| name: string | undefined, | ||||||
| localize: (key: string, vars?: Record<string, unknown> | Array<string | number>) => string, | ||||||
| name: string | null | undefined, | ||||||
| localize: (key: TranslationKeys, vars?: Record<string, unknown>) => string, | ||||||
| ): string | null { | ||||||
| // If only avatar upload is pending (separate endpoint), suppress the no-changes toast. | ||||||
| if (noVersionChange && avatarActionState === 'upload') { | ||||||
|
|
@@ -72,6 +73,7 @@ export function composeAgentUpdatePayload(data: AgentForm, agent_id?: string | n | |||||
| recursion_limit, | ||||||
| category, | ||||||
| support_contact, | ||||||
| tool_options, | ||||||
| avatar_action: avatarActionState, | ||||||
| } = data; | ||||||
|
|
||||||
|
|
@@ -97,6 +99,7 @@ export function composeAgentUpdatePayload(data: AgentForm, agent_id?: string | n | |||||
| recursion_limit, | ||||||
| category, | ||||||
| support_contact, | ||||||
| tool_options, | ||||||
| ...(shouldResetAvatar ? { avatar: null } : {}), | ||||||
| }, | ||||||
| provider, | ||||||
|
|
@@ -545,7 +548,7 @@ export default function AgentPanel() { | |||||
| <AgentFooter | ||||||
| createMutation={create} | ||||||
| updateMutation={update} | ||||||
| isAvatarUploading={isAvatarUploadInFlight || uploadAvatarMutation.isPending} | ||||||
| isAvatarUploading={isAvatarUploadInFlight || uploadAvatarMutation.isLoading} | ||||||
|
||||||
| isAvatarUploading={isAvatarUploadInFlight || uploadAvatarMutation.isLoading} | |
| isAvatarUploading={isAvatarUploadInFlight || uploadAvatarMutation.isPending} |
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.
The default value assignment for lang uses object destructuring with a default, but the condition
?? ({} as ParsedArgs)means that if useParseArgs returns null, the destructuring will fail before the default value can be applied. The correct approach is to use optional chaining and nullish coalescing before destructuring, or handle the null case explicitly.