mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-08 08:15:38 +00:00
* feat(core): add configurable default timeout for foreground shell commands Foreground shell commands started by the agent time out after a hardcoded 120s (DEFAULT_FOREGROUND_TIMEOUT_MS). A per-call `timeout` param can raise that for a single command, but there is no way to change the default for a project or session, so users repeatedly watch long-running commands fail at the 2-minute mark. Add a `tools.shell.defaultTimeoutMs` setting that feeds the existing timeout resolution. Precedence is now: per-call `timeout` param > setting > built-in default. When the setting is unset, behavior is unchanged; a value of 0 disables the timeout, matching the existing per-call semantics. Fixes #5838 * fix(core): add mock getShellDefaultTimeoutMs + bound defaultTimeoutMs Address review on #6628: - Add getShellDefaultTimeoutMs to mock configs in coreToolScheduler.test.ts and toAutoClassifierInput.test.ts (ShellTool construction now reads it). - Add minimum: 0 / maximum: 600000 to the defaultTimeoutMs setting so a negative value can't reach AbortSignal.timeout(); regenerate schema. * chore(core): polish shell defaultTimeoutMs per review - shell.ts: debug-log the resolved foreground timeout (per-call vs configured default vs built-in) for observability - settingsSchema.ts: use type 'integer' for tools.shell.defaultTimeoutMs to match sibling visionBridgeTimeoutMs; regenerate settings.schema.json - config.test.ts: add loadCliConfig test asserting tools.shell.defaultTimeoutMs maps to Config.getShellDefaultTimeoutMs() * fix(core): validate shell defaultTimeoutMs and fix disabled-timeout hint Address review on the configurable foreground shell timeout: - Config: validate shellDefaultTimeoutMs at construction, mirroring visionBridgeTimeoutMs, but allow 0 (disables the timeout). Negative, fractional, or out-of-range values now coerce to undefined instead of reaching AbortSignal.timeout() via a hand-edited settings.json that bypasses schema validation. - settingsSchema: mark tools.shell.defaultTimeoutMs requiresRestart, since Config.shellDefaultTimeoutMs is private readonly with no setter, so a mid-session change cannot take effect. - shell: when the timeout is disabled (effectiveTimeout === 0), suppress the long-run backgrounding hint instead of firing it on every command over ~1s via the longRunThresholdFor floor. - shell: correct the precedence comment; 0 disables only at the settings/default level, as the per-call timeout param rejects <= 0. Add coverage for negative/fractional coercion to the built-in default and for 0 disabling the timeout without emitting the spurious hint. --------- Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com> |
||
|---|---|---|
| .. | ||
| design | ||
| developers | ||
| e2e-tests | ||
| plans | ||
| users | ||
| verification/abort-controller-refactor | ||
| _meta.ts | ||
| index.md | ||