Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/opencode/src/tool/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ export const ShellTool = Tool.define(
const shell = Shell.acceptable(cfg.shell)
const name = Shell.name(shell)
const limits = yield* trunc.limits()
const prompt = ShellPrompt.render(name, process.platform, limits)
const prompt = ShellPrompt.render(name, process.platform, { ...limits, defaultTimeoutMs: DEFAULT_TIMEOUT })
log.info("shell tool using shell", { shell })

return {
Expand Down
7 changes: 4 additions & 3 deletions packages/opencode/src/tool/shell/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const descriptions = {
export type Limits = {
maxLines: number
maxBytes: number
defaultTimeoutMs: number
}

export function parameterSchema(description: string) {
Expand Down Expand Up @@ -102,7 +103,7 @@ function bashCommandSection(chain: string, limits: Limits) {

Usage notes:
- The command argument is required.
- You can specify an optional timeout in milliseconds. If not specified, commands will time out after 120000ms (2 minutes).
- You can specify an optional timeout in milliseconds. If not specified, commands will time out after ${limits.defaultTimeoutMs}ms.
- It is very helpful if you write a clear, concise description of what this command does in 5-10 words.
- If the output exceeds ${limits.maxLines} lines or ${limits.maxBytes} bytes, it will be truncated and the full output will be written to a file. You can use Read with offset/limit to read specific sections or Grep to search the full content. Do NOT use \`head\`, \`tail\`, or other truncation commands to limit output; the full output will already be captured to a file for more precise searching.

Expand Down Expand Up @@ -148,7 +149,7 @@ Before executing the command, please follow these steps:

Usage notes:
- The command argument is required.
- You can specify an optional timeout in milliseconds. If not specified, commands will time out after 120000ms (2 minutes).
- You can specify an optional timeout in milliseconds. If not specified, commands will time out after ${limits.defaultTimeoutMs}ms.
- It is very helpful if you write a clear, concise description of what this command does in 5-10 words.
- If the output exceeds ${limits.maxLines} lines or ${limits.maxBytes} bytes, it will be truncated and the full output will be written to a file. You can use Read with offset/limit to read specific sections or Grep to search the full content. Do NOT use \`Select-Object -First\`, \`Select-Object -Last\`, or other truncation commands to limit output; the full output will already be captured to a file for more precise searching.

Expand Down Expand Up @@ -198,7 +199,7 @@ Before executing the command, please follow these steps:

Usage notes:
- The command argument is required.
- You can specify an optional timeout in milliseconds. If not specified, commands will time out after 120000ms (2 minutes).
- You can specify an optional timeout in milliseconds. If not specified, commands will time out after ${limits.defaultTimeoutMs}ms.
- It is very helpful if you write a clear, concise description of what this command does in 5-10 words.
- If the output exceeds ${limits.maxLines} lines or ${limits.maxBytes} bytes, it will be truncated and the full output will be written to a file. You can use Read with offset/limit to read specific sections or Grep to search the full content. Do NOT use \`more\` or other pagination commands to limit output; the full output will already be captured to a file for more precise searching.

Expand Down
Loading