Support configurable timeouts for thread shell commands (#41384)

## What changed

- Add an optional `timeoutMs` parameter to `thread/shellCommand` and propagate it to user shell execution.
- Preserve the one-hour default when the parameter is omitted or `null`, allow longer deadlines, and treat `0` as an immediate timeout.
- Reject negative or otherwise invalid values before execution. Timing out an auxiliary shell command leaves its active turn running.

## Testing

- Cover default, extended, immediate, invalid, standalone, active-turn, and interruption behavior.

GitOrigin-RevId: d72f67793d9766b7383f28d30140270a4a76a495
This commit is contained in:
gero-oai
2026-08-28 18:07:40 +00:00
committed by copyberry
parent 4ee04c0aa5
commit e4d0ba4e92
20 changed files with 475 additions and 45 deletions
@@ -1129,6 +1129,12 @@ pub struct ThreadShellCommandParams {
/// such as pipes, redirects, and quoting. This runs unsandboxed with full
/// access rather than inheriting the thread sandbox policy.
pub command: String,
/// Maximum execution time in milliseconds. Defaults to one hour when omitted
/// or null. Must be non-negative; zero requests an immediate timeout, not
/// unlimited execution. Does not affect the immediate RPC acknowledgement.
#[ts(type = "number | null")]
#[ts(optional = nullable)]
pub timeout_ms: Option<i64>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]