@link-assistant/hive-mind 1.9.2 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @link-assistant/hive-mind
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9b56b26: feat(solve): configure MCP_TIMEOUT and MCP_TOOL_TIMEOUT for claude tool calls
8
+
9
+ Added MCP timeout configuration to prevent tool calls from hanging indefinitely:
10
+ - Added `mcpTimeout` config (default: 900000ms / 15 minutes) for MCP server startup
11
+ - Added `mcpToolTimeout` config (default: 900000ms / 15 minutes) for MCP tool execution
12
+ - Support for override via `MCP_TIMEOUT`/`HIVE_MIND_MCP_TIMEOUT` and `MCP_TOOL_TIMEOUT`/`HIVE_MIND_MCP_TOOL_TIMEOUT` environment variables
13
+ - Updated `getClaudeEnv()` to pass both timeout values to Claude CLI
14
+ - Added verbose logging for MCP timeout values
15
+
16
+ Fixes #1066
17
+
3
18
  ## 1.9.2
4
19
 
5
20
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/hive-mind",
3
- "version": "1.9.2",
3
+ "version": "1.10.0",
4
4
  "description": "AI-powered issue solver and hive mind for collaborative problem solving",
5
5
  "main": "src/hive.mjs",
6
6
  "type": "module",
@@ -881,9 +881,12 @@ export const executeClaudeCommand = async params => {
881
881
  // See issue #1146 for details on thinking budget translation
882
882
  const { thinkingBudget: resolvedThinkingBudget, thinkLevel, isNewVersion } = await resolveThinkingSettings(argv, log);
883
883
 
884
- // Set CLAUDE_CODE_MAX_OUTPUT_TOKENS (see issue #1076) and optionally MAX_THINKING_TOKENS (see issue #1146)
884
+ // Set CLAUDE_CODE_MAX_OUTPUT_TOKENS (see issue #1076), MAX_THINKING_TOKENS (see issue #1146),
885
+ // and MCP timeout configurations (see issue #1066)
885
886
  const claudeEnv = getClaudeEnv({ thinkingBudget: resolvedThinkingBudget });
886
887
  if (argv.verbose) await log(`📊 CLAUDE_CODE_MAX_OUTPUT_TOKENS: ${claudeCode.maxOutputTokens}`, { verbose: true });
888
+ if (argv.verbose) await log(`📊 MCP_TIMEOUT: ${claudeCode.mcpTimeout}ms (server startup)`, { verbose: true });
889
+ if (argv.verbose) await log(`📊 MCP_TOOL_TIMEOUT: ${claudeCode.mcpToolTimeout}ms (tool execution)`, { verbose: true });
887
890
  if (resolvedThinkingBudget !== undefined) {
888
891
  await log(`📊 MAX_THINKING_TOKENS: ${resolvedThinkingBudget}`, { verbose: true });
889
892
  }
@@ -90,6 +90,15 @@ export const claudeCode = {
90
90
  // Default: 64000 (matches Claude Sonnet/Opus/Haiku 4.5 model capabilities)
91
91
  // Set via CLAUDE_CODE_MAX_OUTPUT_TOKENS or HIVE_MIND_CLAUDE_CODE_MAX_OUTPUT_TOKENS
92
92
  maxOutputTokens: parseIntWithDefault('CLAUDE_CODE_MAX_OUTPUT_TOKENS', parseIntWithDefault('HIVE_MIND_CLAUDE_CODE_MAX_OUTPUT_TOKENS', 64000)),
93
+ // MCP (Model Context Protocol) timeout configurations
94
+ // See: https://github.com/link-assistant/hive-mind/issues/1066
95
+ // See: https://code.claude.com/docs/en/settings#environment-variables
96
+ // MCP_TIMEOUT: Timeout in milliseconds for MCP server startup
97
+ // MCP_TOOL_TIMEOUT: Timeout in milliseconds for MCP tool execution
98
+ // Default: 900000ms (15 minutes) to accommodate long-running Playwright operations
99
+ // Set via MCP_TIMEOUT/MCP_TOOL_TIMEOUT or HIVE_MIND_MCP_TIMEOUT/HIVE_MIND_MCP_TOOL_TIMEOUT
100
+ mcpTimeout: parseIntWithDefault('MCP_TIMEOUT', parseIntWithDefault('HIVE_MIND_MCP_TIMEOUT', 900000)),
101
+ mcpToolTimeout: parseIntWithDefault('MCP_TOOL_TIMEOUT', parseIntWithDefault('HIVE_MIND_MCP_TOOL_TIMEOUT', 900000)),
93
102
  };
94
103
 
95
104
  // Default max thinking budget for Claude Code (see issue #1146)
@@ -156,8 +165,18 @@ export const supportsThinkingBudget = (version, minVersion = '2.1.12') => {
156
165
 
157
166
  // Helper function to get Claude CLI environment with CLAUDE_CODE_MAX_OUTPUT_TOKENS set
158
167
  // Optionally sets MAX_THINKING_TOKENS when thinkingBudget is provided (see issue #1146)
168
+ // Also sets MCP_TIMEOUT and MCP_TOOL_TIMEOUT for MCP tool execution (see issue #1066)
159
169
  export const getClaudeEnv = (options = {}) => {
160
- const env = { ...process.env, CLAUDE_CODE_MAX_OUTPUT_TOKENS: String(claudeCode.maxOutputTokens) };
170
+ const env = {
171
+ ...process.env,
172
+ CLAUDE_CODE_MAX_OUTPUT_TOKENS: String(claudeCode.maxOutputTokens),
173
+ // MCP timeout configurations to prevent tool calls from hanging indefinitely
174
+ // See: https://github.com/link-assistant/hive-mind/issues/1066
175
+ // MCP_TIMEOUT: Timeout for MCP server startup
176
+ // MCP_TOOL_TIMEOUT: Timeout for MCP tool execution (the one that prevents stuck tools)
177
+ MCP_TIMEOUT: String(claudeCode.mcpTimeout),
178
+ MCP_TOOL_TIMEOUT: String(claudeCode.mcpToolTimeout),
179
+ };
161
180
  // Set MAX_THINKING_TOKENS if thinkingBudget is provided
162
181
  // This controls Claude Code's extended thinking feature (Claude Code >= 2.1.12)
163
182
  // Default is 31999, set to 0 to disable thinking, max is 63999 for 64K output models