From 8f06c561eebabe7b632f97679892d2b6078fff7e Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Mon, 27 Jul 2026 19:53:57 +0800 Subject: [PATCH] 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. --- docs/config-catalog.md | 4 +++- packages/code-runtime/code-runtime-worker/README.i18n.yaml | 4 ++-- packages/code-runtime/code-runtime-worker/README.md | 2 +- packages/code-runtime/code-runtime-worker/README.zh.md | 2 +- packages/code-runtime/code-runtime-worker/src/index.ts | 4 +++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/config-catalog.md b/docs/config-catalog.md index 16dbb63ff0..cd272840f5 100644 --- a/docs/config-catalog.md +++ b/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 /** diff --git a/packages/code-runtime/code-runtime-worker/README.i18n.yaml b/packages/code-runtime/code-runtime-worker/README.i18n.yaml index 6a84161944..7245b80dcf 100644 --- a/packages/code-runtime/code-runtime-worker/README.i18n.yaml +++ b/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 diff --git a/packages/code-runtime/code-runtime-worker/README.md b/packages/code-runtime/code-runtime-worker/README.md index 90f6f1bce0..83c9a39897 100644 --- a/packages/code-runtime/code-runtime-worker/README.md +++ b/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 diff --git a/packages/code-runtime/code-runtime-worker/README.zh.md b/packages/code-runtime/code-runtime-worker/README.zh.md index 56aa99a116..8e6c15eccd 100644 --- a/packages/code-runtime/code-runtime-worker/README.zh.md +++ b/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` 最大延迟),此外没有其他可调项。 ## 设计 diff --git a/packages/code-runtime/code-runtime-worker/src/index.ts b/packages/code-runtime/code-runtime-worker/src/index.ts index c742bc596d..be156c85ba 100644 --- a/packages/code-runtime/code-runtime-worker/src/index.ts +++ b/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 /**