@myrialabs/clopen 0.4.1 → 0.4.2

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/backend/index.ts CHANGED
@@ -99,7 +99,15 @@ const app = new Elysia()
99
99
 
100
100
  // MCP remote server endpoint for Open Code custom tools
101
101
  // Handles GET (SSE stream), POST (JSON-RPC), DELETE (session close)
102
- .all('/mcp', async ({ request }) => handleMcpRequest(request))
102
+ .all('/mcp', async ({ request, server }) => {
103
+ // MCP tool calls can run far longer than Bun's default 10s idle timeout.
104
+ // While a tool executes, the streaming response sends no bytes, so Bun
105
+ // would close the idle connection and the call surfaces as MCP error
106
+ // -32001 ("Request timed out"). Disable the idle timeout for this
107
+ // long-lived endpoint only — every other route keeps the safe default.
108
+ server?.timeout(request, 0);
109
+ return handleMcpRequest(request);
110
+ })
103
111
 
104
112
  // HTTP file upload — mounted before the WS plugin so /api/files/upload
105
113
  // stays on the HTTP path through the Vite dev proxy.
@@ -17,6 +17,7 @@ import { mcpServerQueries } from '$backend/database/queries';
17
17
  import { debug } from '$shared/utils/logger';
18
18
  import { SERVER_ENV } from '../../utils/env';
19
19
  import { validateMcpOutput } from './output-validator';
20
+ import { MCP_TOOL_CALL_TIMEOUT_MS } from '../shared/constants';
20
21
 
21
22
  /**
22
23
  * User-defined MCP Servers Configuration
@@ -443,7 +444,7 @@ export function getOpenCodeMcpConfig(): Record<string, McpRemoteConfig> {
443
444
  type: 'remote',
444
445
  url: `http://localhost:${port}/mcp`,
445
446
  enabled: true,
446
- timeout: 10000,
447
+ timeout: MCP_TOOL_CALL_TIMEOUT_MS,
447
448
  },
448
449
  };
449
450
  }
@@ -557,7 +558,7 @@ export function getCopilotMcpConfig(): Record<string, MCPHTTPServerConfig> {
557
558
  type: 'http',
558
559
  url: `http://localhost:${port}/mcp`,
559
560
  tools,
560
- timeout: 10_000,
561
+ timeout: MCP_TOOL_CALL_TIMEOUT_MS,
561
562
  },
562
563
  };
563
564
  }
@@ -603,7 +604,7 @@ export function getQwenMcpConfig(): Record<string, QwenMcpServerConfig> {
603
604
  'clopen-mcp': {
604
605
  httpUrl: `http://localhost:${port}/mcp`,
605
606
  includeTools,
606
- timeout: 10_000,
607
+ timeout: MCP_TOOL_CALL_TIMEOUT_MS,
607
608
  trust: true,
608
609
  },
609
610
  };
@@ -23,6 +23,22 @@
23
23
  /** Namespace key of the internal remote-HTTP MCP bridge (`/mcp`). */
24
24
  export const INTERNAL_BRIDGE_NAMESPACE = 'clopen-mcp';
25
25
 
26
+ /**
27
+ * Per-tool-call timeout (ms) Clopen hands to non-Claude engines for the
28
+ * internal `/mcp` bridge. MCP tools can legitimately run far longer than the
29
+ * engines' short defaults (e.g. OpenCode's 5s), so we make this effectively
30
+ * unlimited — a finite-but-huge value because the engine SDKs expose no
31
+ * "disable" sentinel and feed this straight into setTimeout, which overflows
32
+ * above 2^31-1 ms (~24.8 days). 7 days is beyond any real tool call yet safely
33
+ * under that ceiling.
34
+ *
35
+ * NOTE: this only governs the engine's CLIENT-side request timeout. The Clopen
36
+ * HTTP server's own idle timeout is disabled separately on the `/mcp` route via
37
+ * Bun's `server.timeout(request, 0)` (see backend/index.ts) — both layers must
38
+ * be lifted or a long tool call still dies with MCP error -32001.
39
+ */
40
+ export const MCP_TOOL_CALL_TIMEOUT_MS = 7 * 24 * 60 * 60 * 1000; // 7 days
41
+
26
42
  /** Prefix reserved for internal MCP namespaces (marks a key as "ours"). */
27
43
  export const INTERNAL_PREFIX = 'clopen';
28
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrialabs/clopen",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "All-in-one web workspace for Claude Code & OpenCode — chat, terminal, git, browser preview, checkpoints, and real-time collaboration",
5
5
  "author": "Myria Labs",
6
6
  "license": "MIT",
@@ -99,6 +99,7 @@
99
99
  "@openai/codex-sdk": "0.135.0",
100
100
  "@opencode-ai/sdk": "1.15.12",
101
101
  "@qwen-code/sdk": "0.1.7",
102
+ "@sinclair/typebox": "0.34.48",
102
103
  "@xterm/addon-clipboard": "^0.2.0",
103
104
  "@xterm/addon-fit": "^0.11.0",
104
105
  "@xterm/addon-ligatures": "^0.10.0",