Skip to content

resolveShellTimeoutBudget

resolveShellTimeoutBudget(requestedMs, defaultMs, ceilingMs): ShellTimeoutBudget

Defined in: packages/agent/src/tools/GthDevToolkit.ts:143

[[EXT-125]] — resolve a call’s time budget against the config ceiling.

Over the ceiling is REFUSED, not clamped, and that is the whole safety story. Silently clamping would run the command on a budget the model did not ask for, kill it, and leave the model reading a kill it has no way to attribute — a fact about our gate laundered into a claim about the command, which is exactly what [[EXT-66]] settled must not happen. Refusing before the spawn costs nothing (no process, no side effect, no output) and leaves the model one legible move: re-call at or under a number it has now been told.

requestedMs is validated here as well as in the schema. The schema is the only thing standing between a provider’s arguments and this function, and a tool argument is model-authored data on the most safety-sensitive path in the repo; a second check costs one comparison and means the ceiling does not depend on a zod version’s coercion behaviour.

number | undefined

number

number

ShellTimeoutBudget