fix(mcp): raise default tool read timeout from 30s to 60s (#247)

This commit is contained in:
matevip 2026-06-03 09:47:18 +08:00
parent 9f02a0a221
commit c92bfa1f12
9 changed files with 27 additions and 11 deletions

View File

@ -68,7 +68,7 @@ public class McpServerService {
entity.setConnectTimeoutSeconds(30);
}
if (entity.getReadTimeoutSeconds() == null) {
entity.setReadTimeoutSeconds(30);
entity.setReadTimeoutSeconds(60);
}
entity.setLastStatus("disconnected");
entity.setToolCount(0);

View File

@ -547,7 +547,7 @@ VALUES (
NULL,
FALSE,
30,
30,
60,
'disconnected',
NULL,
NULL,
@ -578,7 +578,7 @@ VALUES (
NULL,
FALSE,
30,
30,
60,
'disconnected',
NULL,
NULL,

View File

@ -596,7 +596,7 @@ VALUES (
NULL,
FALSE,
30,
30,
60,
'disconnected',
NULL,
NULL,
@ -627,7 +627,7 @@ VALUES (
NULL,
FALSE,
30,
30,
60,
'disconnected',
NULL,
NULL,

View File

@ -593,7 +593,7 @@ VALUES (
NULL,
FALSE,
30,
30,
60,
'disconnected',
NULL,
NULL,
@ -624,7 +624,7 @@ VALUES (
NULL,
FALSE,
30,
30,
60,
'disconnected',
NULL,
NULL,

View File

@ -548,7 +548,7 @@ VALUES (
NULL,
FALSE,
30,
30,
60,
'disconnected',
NULL,
NULL,
@ -579,7 +579,7 @@ VALUES (
NULL,
FALSE,
30,
30,
60,
'disconnected',
NULL,
NULL,

View File

@ -0,0 +1,8 @@
-- Raise the default per-request (read) timeout for MCP servers from 30s to 60s.
-- A 30s ceiling cut off MCP tools whose single callTool round-trip legitimately
-- runs longer (data-heavy or compute-heavy tools), surfacing as a request timeout
-- with no retry. The application layer already falls back to 60s when the column
-- is null; this aligns the schema default so the value is consistent everywhere.
-- Only changes the column default for newly inserted rows — existing rows keep
-- whatever value they were given. Idempotent.
ALTER TABLE mate_mcp_server ALTER COLUMN read_timeout_seconds SET DEFAULT 60;

View File

@ -0,0 +1,8 @@
-- Raise the default per-request (read) timeout for MCP servers from 30s to 60s.
-- A 30s ceiling cut off MCP tools whose single callTool round-trip legitimately
-- runs longer (data-heavy or compute-heavy tools), surfacing as a request timeout
-- with no retry. The application layer already falls back to 60s when the column
-- is null; this aligns the schema default so the value is consistent everywhere.
-- Only changes the column default for newly inserted rows — existing rows keep
-- whatever value they were given. Idempotent.
ALTER TABLE mate_mcp_server ALTER COLUMN read_timeout_seconds SET DEFAULT 60;

View File

@ -189,7 +189,7 @@ function hydrateFromServer(s: McpServer) {
envJson: s.envJson || '',
cwd: s.cwd || '',
connectTimeoutSeconds: s.connectTimeoutSeconds || 30,
readTimeoutSeconds: s.readTimeoutSeconds || 30,
readTimeoutSeconds: s.readTimeoutSeconds || 60,
enabled: s.enabled,
})
}

View File

@ -63,7 +63,7 @@ export function emptyMcpForm(): McpServerForm {
envJson: '',
cwd: '',
connectTimeoutSeconds: 30,
readTimeoutSeconds: 30,
readTimeoutSeconds: 60,
enabled: true,
}
}