You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shell tool description advertises hardcoded 2-minute default, even when OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS is set #25913
The shell tool's description text advertises a hardcoded 120000ms (2 minutes) default timeout to the model, regardless of the runtime value of DEFAULT_TIMEOUT (which respects OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS). This trains LLMs to override operator-configured defaults with their own (often shorter) explicit timeout values, causing premature SIGTERM on long-running commands.
Current behavior
In packages/opencode/src/tool/shell/prompt.ts, the per-shell description sections (bashCommandSection, powershellCommandSection, cmdCommandSection) each hardcode this line verbatim:
You can specify an optional timeout in milliseconds. If not specified, commands will time out after 120000ms (2 minutes).
Meanwhile, the actual runtime default is computed at packages/opencode/src/tool/shell.ts:29:
When an operator sets e.g. OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=7200000 (2 hours), the model still reads "2 minutes" in its tool description and frequently emits explicit timeout values clustered around its mental model of "2 minutes" — defeating the operator's intent. Combined with the params.timeout ?? DEFAULT_TIMEOUT fallback at shell.ts:603, any LLM-supplied value wins.
Expected behavior
The advertised default in the tool description should reflect the actual runtime DEFAULT_TIMEOUT value, so the model is told the truth about how long it has before SIGTERM.
Suggested fix
shell.ts:588 already calls ShellPrompt.render(name, process.platform, limits), where limits: Limits is plumbed through to the command-section helpers. Two small mechanical changes close the gap:
Extend the Limits type in prompt.ts to include defaultTimeoutMs: number (or pass DEFAULT_TIMEOUT as a separate fourth argument to render).
Replace the hardcoded 120000ms (2 minutes) literal in bashCommandSection, powershellCommandSection, and cmdCommandSection with ${limits.defaultTimeoutMs}ms (or a similar interpolation that reflects the actual configured value).
Activity
nabilfreeman commentedon May 23, 2026
Hey @jlongster, bumping you on this issue and the related pull request