clay-server 3.4.0-beta.25 → 3.4.0-beta.26

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.
@@ -3,6 +3,7 @@
3
3
  // Implements the YOKE Adapter contract once for standard ACP agents.
4
4
 
5
5
  var AcpProcessManager = require("../acp-process-manager").AcpProcessManager;
6
+ var INITIALIZE_TIMEOUT_MS = require("../interface").INITIALIZE_TIMEOUT_MS;
6
7
  var createAcpQueryHandle = require("../acp-query-handle").createAcpQueryHandle;
7
8
  var profiles = require("../acp-agent-profiles");
8
9
  var driverRuntime = require("../acp-driver-runtime");
@@ -178,7 +179,7 @@ function createAcpAdapter(vendor, opts) {
178
179
  session: { configOptions: { boolean: {} } },
179
180
  },
180
181
  });
181
- initResult = await acp.send("initialize", initializeParams, 30000);
182
+ initResult = await acp.send("initialize", initializeParams, INITIALIZE_TIMEOUT_MS);
182
183
  await driverRuntime.callAsync(driver, "onInitialize", context({ acp: acp, initResult: initResult }), function() {});
183
184
  if (shuttingDown) throw new Error(driver.displayName + " adapter is shutting down");
184
185
  } catch (e) {
@@ -6,6 +6,7 @@
6
6
  var path = require("path");
7
7
  var fs = require("fs");
8
8
  var { CodexAppServer } = require("../codex-app-server");
9
+ var INITIALIZE_TIMEOUT_MS = require("../interface").INITIALIZE_TIMEOUT_MS;
9
10
  var skillDiscovery = require("../skill-discovery");
10
11
  var { resolveOsUserInfo } = require("../../os-users");
11
12
  var backgroundTasks = require("../codex-background-tasks");
@@ -1577,7 +1578,7 @@ function createCodexAdapter(opts) {
1577
1578
  await _appServer.send("initialize", {
1578
1579
  clientInfo: { name: "clay", title: "Clay", version: "1.0.0" },
1579
1580
  capabilities: { experimentalApi: true },
1580
- });
1581
+ }, INITIALIZE_TIMEOUT_MS);
1581
1582
  _appServer.notify("initialized", {});
1582
1583
 
1583
1584
  if (_shuttingDown) {
@@ -14,6 +14,7 @@
14
14
 
15
15
  var { execFile } = require("child_process");
16
16
  var { KiroAcpServer, findKiroPath } = require("../kiro-acp-server");
17
+ var INITIALIZE_TIMEOUT_MS = require("../interface").INITIALIZE_TIMEOUT_MS;
17
18
  var skillDiscovery = require("../skill-discovery");
18
19
  var { KIRO_DEFAULTS } = require("../../kiro-defaults");
19
20
 
@@ -991,9 +992,6 @@ function createKiroAdapter(opts) {
991
992
  return _fetchKasToken(_binaryPath, _cwd);
992
993
  });
993
994
  await _acp.start();
994
- // kiro-cli boots the KAS server, MCP subsystem and SQLite before it
995
- // answers initialize, which measures ~20s cold. 30s left no margin and
996
- // timed out under load, so allow a wide window here.
997
995
  await _acp.send("initialize", {
998
996
  protocolVersion: 1,
999
997
  clientInfo: { name: "clay", version: "1.0.0" },
@@ -1003,7 +1001,7 @@ function createKiroAdapter(opts) {
1003
1001
  // calls, so implementing them later means bypassing canUseTool and
1004
1002
  // needs explicit cwd confinement first.
1005
1003
  clientCapabilities: { fs: { readTextFile: false, writeTextFile: false } },
1006
- }, 90000);
1004
+ }, INITIALIZE_TIMEOUT_MS);
1007
1005
  _initialized = true;
1008
1006
 
1009
1007
  if (_shuttingDown) throw createShutdownError();
@@ -11,6 +11,14 @@
11
11
  var TOOL_POLICIES = ["ask", "allow-all"];
12
12
  var BACKGROUND_TASK_TYPES = ["shell", "agent", "monitor", "other"];
13
13
 
14
+ // Shared budget for the initialize handshake every vendor process manager
15
+ // performs. Agents do their cold start before answering it: kiro-cli boots the
16
+ // KAS server, MCP subsystem and SQLite first, which measures ~20s, and Codex
17
+ // launches its configured MCP servers. The cost is asymmetric, since too short
18
+ // a window makes a working agent unusable while too long a one only delays the
19
+ // error for an agent that is already broken, so keep it generous.
20
+ var INITIALIZE_TIMEOUT_MS = 90000;
21
+
14
22
  /*
15
23
  * Optional adapter event contract:
16
24
  * { yokeType: "background_tasks_changed", tasks: [{ task_id, task_type, description }] }
@@ -104,6 +112,7 @@ function validateQueryHandle(handle) {
104
112
 
105
113
  module.exports = {
106
114
  TOOL_POLICIES: TOOL_POLICIES,
115
+ INITIALIZE_TIMEOUT_MS: INITIALIZE_TIMEOUT_MS,
107
116
  BACKGROUND_TASK_TYPES: BACKGROUND_TASK_TYPES,
108
117
  ADAPTER_METHODS: ADAPTER_METHODS,
109
118
  QUERY_HANDLE_METHODS: QUERY_HANDLE_METHODS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clay-server",
3
- "version": "3.4.0-beta.25",
3
+ "version": "3.4.0-beta.26",
4
4
  "description": "Self-hosted team workspace for Claude Code and Codex. Multi-user, browser-based, with persistent AI mates.",
5
5
  "bin": {
6
6
  "clay-server": "./bin/cli.js",