-
Notifications
You must be signed in to change notification settings - Fork 489
feat: add configurable MCP server loading timeout #580
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 |
|---|---|---|
|
|
@@ -589,6 +589,7 @@ export function hydrateStoreFromSettings(settings: GlobalSettings): void { | |
| ...(settings.keyboardShortcuts as unknown as Partial<typeof current.keyboardShortcuts>), | ||
| }, | ||
| mcpServers: settings.mcpServers ?? [], | ||
| mcpLoadingTimeout: settings.mcpLoadingTimeout ?? 10000, | ||
|
Contributor
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. The default timeout value To improve maintainability and have a single source of truth, I recommend defining this default value as an exported constant in For example, in export const DEFAULT_MCP_LOADING_TIMEOUT = 10000;Then you could use |
||
| promptCustomization: settings.promptCustomization ?? {}, | ||
| projects, | ||
| currentProject, | ||
|
|
@@ -650,6 +651,7 @@ function buildSettingsUpdateFromStore(): Record<string, unknown> { | |
| skipSandboxWarning: state.skipSandboxWarning, | ||
| keyboardShortcuts: state.keyboardShortcuts, | ||
| mcpServers: state.mcpServers, | ||
| mcpLoadingTimeout: state.mcpLoadingTimeout, | ||
| promptCustomization: state.promptCustomization, | ||
| projects: state.projects, | ||
| trashedProjects: state.trashedProjects, | ||
|
|
||
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.
This test, and others in this
describeblock for configurable timeouts, don't actually verify the timeout functionality as they just asserttrueto betrue. This means the new timeout logic is not being properly tested.You can use
vi.useFakeTimers()to test the timeout logic effectively. Here's an example of how you could verify that the correct timeout is being used:Applying this pattern to the other placeholder tests would ensure the new timeout feature is robust.