Ver código fonte

docs(code-runtime): state the maxWallMs upper bound in the public Config contract

The load-time range check rejects a maxWallMs above Node's maximum
setTimeout delay, but the constraint appeared only in the README design
section. Deployments reading the Config field JSDoc, the generated config
catalog, or the README config summary saw maxWallMs described as a
positive finite wall-clock ceiling, so an out-of-range value looked valid
until plugin load failed.
Chinesezjc 1 mês atrás
pai
commit
8f06c561ee

+ 3 - 1
docs/config-catalog.md

@@ -305,7 +305,9 @@ export interface Config {
   /**
    * Wall-clock ceiling in milliseconds; never pauses for anything. The
    * backstop for what busy-time cannot see (a program awaiting a promise
-   * nobody will resolve).
+   * nobody will resolve). At most `2_147_483_647` (Node's maximum
+   * `setTimeout` delay, about 24.9 days): a longer value is rejected at load
+   * because `setTimeout` would clamp it to 1 ms.
    */
   maxWallMs?: number
   /**

+ 2 - 2
packages/code-runtime/code-runtime-worker/README.i18n.yaml

@@ -2,5 +2,5 @@
 # side as of the last confirmed-consistent state. Both languages carry equal authority;
 # after editing either side, bring the other along and re-record with:
 #   pnpm run verify-translation-pairing --write packages/code-runtime/code-runtime-worker/README.md
-README.md: 90f6f1bce07c2a0e83b411b6d85e9cd1cd4a5f31
-README.zh.md: 56aa99a1160a19025c7cb09314ddb7b9aec56890
+README.md: 83c9a398970831e88cb3ef5d71d3f175da97d1f1
+README.zh.md: 8e6c15eccdd83d3b918249920596dcbeee94f2b2

+ 1 - 1
packages/code-runtime/code-runtime-worker/README.md

@@ -16,7 +16,7 @@ Worker-thread implementation of the [`@deepseek-ai/dsh-code-runtime`](../code-ru
     maxOldGenerationSizeMb: 512   # worker heap cap (resourceLimits)
 ```
 
-Every field is validated and defaulted; `maxOutputBytes` is a safe integer of at least four bytes, the remaining fields are positive finite numbers, and there are no other tunables.
+Every field is validated and defaulted; `maxOutputBytes` is a safe integer of at least four bytes, the remaining fields are positive finite numbers, `maxWallMs` is additionally at most `2147483647` (Node's maximum `setTimeout` delay), and there are no other tunables.
 
 ## Design
 

+ 1 - 1
packages/code-runtime/code-runtime-worker/README.zh.md

@@ -16,7 +16,7 @@
     maxOldGenerationSizeMb: 512   # worker heap cap (resourceLimits)
 ```
 
-每个字段都会验证并提供默认值;`maxOutputBytes` 必须是至少 4 字节的安全整数,其余字段必须是有限正数,此外没有其他可调项。
+每个字段都会验证并提供默认值;`maxOutputBytes` 必须是至少 4 字节的安全整数,其余字段必须是有限正数,`maxWallMs` 还必须不超过 `2147483647`(Node 的 `setTimeout` 最大延迟),此外没有其他可调项。
 
 ## 设计
 

+ 3 - 1
packages/code-runtime/code-runtime-worker/src/index.ts

@@ -36,7 +36,9 @@ export interface Config {
   /**
    * Wall-clock ceiling in milliseconds; never pauses for anything. The
    * backstop for what busy-time cannot see (a program awaiting a promise
-   * nobody will resolve).
+   * nobody will resolve). At most `2_147_483_647` (Node's maximum
+   * `setTimeout` delay, about 24.9 days): a longer value is rejected at load
+   * because `setTimeout` would clamp it to 1 ms.
    */
   maxWallMs?: number
   /**