@nexus-cortex/core 4.108.9 → 4.108.10

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.
@@ -2,12 +2,22 @@ export type ToolUseBlockLike = {
2
2
  name?: string;
3
3
  input?: unknown;
4
4
  };
5
+ /**
6
+ * CORTEX_OUTER_TOOL_TIMEOUT_MS (2026-09-13): a FLOOR (ms) for the outer batch deadline. Non-Bash tools
7
+ * without a limit of their own (CreateArtifactTool persistent launches, ctr-optimization) and Task
8
+ * sub-agents mid-turn were still killed at the static ~150s (5 TB4.0 kills). With the floor set the
9
+ * deadline becomes max(computed, floor + grace). Unset / 0 / junk = no floor (behaviour unchanged).
10
+ */
11
+ export declare function resolveOuterToolTimeoutFloorMs(env?: NodeJS.ProcessEnv): number;
5
12
  /**
6
13
  * R133 HB-SUBAGENT-TIMEOUT (2026-09-13): a Task batch was aborted at this same ~150s, BELOW the sub-agent's
7
14
  * own timeout (300s hardcoded then; now derived from the parent's remaining turn budget). The optional
8
15
  * `blockTimeoutMs` lookup lets the caller contribute a per-block resolved timeout (Task → resolveSubAgentTimeoutMs)
9
16
  * so the batch abort is >= the sub-agent timeout + grace. Not clamped to the shell ceiling — a sub-agent
10
17
  * legitimately runs for hours under a long turn deadline.
18
+ *
19
+ * `floorMs` (CORTEX_OUTER_TOOL_TIMEOUT_MS, resolved by the caller once per turn) lifts the deadline to at
20
+ * least floor + grace; 0 / undefined / non-finite = no floor.
11
21
  */
12
- export declare function resolveOuterToolDeadlineMs(toolUseBlocks: ReadonlyArray<ToolUseBlockLike>, toolTimeoutMs: number, graceMs: number, blockTimeoutMs?: (block: ToolUseBlockLike, index: number) => number | undefined): number;
22
+ export declare function resolveOuterToolDeadlineMs(toolUseBlocks: ReadonlyArray<ToolUseBlockLike>, toolTimeoutMs: number, graceMs: number, blockTimeoutMs?: (block: ToolUseBlockLike, index: number) => number | undefined, floorMs?: number): number;
13
23
  //# sourceMappingURL=outerToolTimeout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"outerToolTimeout.d.ts","sourceRoot":"","sources":["../../src/orchestrator/outerToolTimeout.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAElE;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAC9C,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAC9E,MAAM,CAgBR"}
1
+ {"version":3,"file":"outerToolTimeout.d.ts","sourceRoot":"","sources":["../../src/orchestrator/outerToolTimeout.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAElE;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAG3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAC9C,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,EAC/E,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAiBR"}
@@ -13,14 +13,27 @@
13
13
  * timer is only ever the true last-resort for a hung tool.
14
14
  */
15
15
  const SHELL_MAX_TIMEOUT_MS = 600_000; // mirrors ShellTool.MAX_TIMEOUT_MS (requested timeouts are clamped there)
16
+ /**
17
+ * CORTEX_OUTER_TOOL_TIMEOUT_MS (2026-09-13): a FLOOR (ms) for the outer batch deadline. Non-Bash tools
18
+ * without a limit of their own (CreateArtifactTool persistent launches, ctr-optimization) and Task
19
+ * sub-agents mid-turn were still killed at the static ~150s (5 TB4.0 kills). With the floor set the
20
+ * deadline becomes max(computed, floor + grace). Unset / 0 / junk = no floor (behaviour unchanged).
21
+ */
22
+ export function resolveOuterToolTimeoutFloorMs(env = process.env) {
23
+ const n = Number(String(env.CORTEX_OUTER_TOOL_TIMEOUT_MS ?? '').trim() || 0);
24
+ return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0;
25
+ }
16
26
  /**
17
27
  * R133 HB-SUBAGENT-TIMEOUT (2026-09-13): a Task batch was aborted at this same ~150s, BELOW the sub-agent's
18
28
  * own timeout (300s hardcoded then; now derived from the parent's remaining turn budget). The optional
19
29
  * `blockTimeoutMs` lookup lets the caller contribute a per-block resolved timeout (Task → resolveSubAgentTimeoutMs)
20
30
  * so the batch abort is >= the sub-agent timeout + grace. Not clamped to the shell ceiling — a sub-agent
21
31
  * legitimately runs for hours under a long turn deadline.
32
+ *
33
+ * `floorMs` (CORTEX_OUTER_TOOL_TIMEOUT_MS, resolved by the caller once per turn) lifts the deadline to at
34
+ * least floor + grace; 0 / undefined / non-finite = no floor.
22
35
  */
23
- export function resolveOuterToolDeadlineMs(toolUseBlocks, toolTimeoutMs, graceMs, blockTimeoutMs) {
36
+ export function resolveOuterToolDeadlineMs(toolUseBlocks, toolTimeoutMs, graceMs, blockTimeoutMs, floorMs) {
24
37
  let maxRequested = 0;
25
38
  let maxResolved = 0;
26
39
  for (let i = 0; i < toolUseBlocks.length; i++) {
@@ -39,6 +52,7 @@ export function resolveOuterToolDeadlineMs(toolUseBlocks, toolTimeoutMs, graceMs
39
52
  maxRequested = t;
40
53
  }
41
54
  const honored = Math.max(Math.min(maxRequested, SHELL_MAX_TIMEOUT_MS), maxResolved);
42
- return Math.max(toolTimeoutMs, honored) + graceMs;
55
+ const floor = Number.isFinite(floorMs) && floorMs > 0 ? floorMs : 0;
56
+ return Math.max(toolTimeoutMs, honored, floor) + graceMs;
43
57
  }
44
58
  //# sourceMappingURL=outerToolTimeout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"outerToolTimeout.js","sourceRoot":"","sources":["../../src/orchestrator/outerToolTimeout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,oBAAoB,GAAG,OAAO,CAAC,CAAC,0EAA0E;AAIhH;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,aAA8C,EAC9C,aAAqB,EACrB,OAAe,EACf,cAA+E;IAE/E,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,CAAC;YAAE,SAAS;QACjB,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW;gBAAE,WAAW,GAAG,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,CAAC,EAAE,IAAI,KAAK,MAAM;YAAE,SAAS,CAAC,0CAA0C;QAC5E,MAAM,CAAC,GAAG,MAAM,CAAE,CAAC,CAAC,KAA2C,EAAE,OAAO,CAAC,CAAC;QAC1E,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,YAAY;YAAE,YAAY,GAAG,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC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CAAC,GAAG,WAAW;gBAAE,WAAW,GAAG,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,CAAC,EAAE,IAAI,KAAK,MAAM;YAAE,SAAS,CAAC,0CAA0C;QAC5E,MAAM,CAAC,GAAG,MAAM,CAAE,CAAC,CAAC,KAA2C,EAAE,OAAO,CAAC,CAAC;QAC1E,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,YAAY;YAAE,YAAY,GAAG,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,oBAAoB,CAAC,EAAE,WAAW,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAK,OAAkB,GAAG,CAAC,CAAC,CAAC,CAAE,OAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5F,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC;AAC3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/core",
3
- "version": "4.108.9",
3
+ "version": "4.108.10",
4
4
  "description": "Core orchestration library implementing Claude CLI architecture patterns",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -47,8 +47,8 @@
47
47
  "@google/generative-ai": "^0.2.1",
48
48
  "@gradio/client": "^2.3.1",
49
49
  "@modelcontextprotocol/sdk": "^1.20.2",
50
- "@nexus-cortex/executors": "4.108.9",
51
- "@nexus-cortex/types": "4.108.9",
50
+ "@nexus-cortex/executors": "4.108.10",
51
+ "@nexus-cortex/types": "4.108.10",
52
52
  "@types/uuid": "^10.0.0",
53
53
  "ajv": "^8.12.0",
54
54
  "chokidar": "^3.6.0",