The open source coding agent.
TypeScript
removed banned command concept
Dax Raad163e23a68b4a
diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.tsindex 3ef44bd5f03..620a8c8db5d 100644--- a/packages/opencode/src/tool/bash.ts+++ b/packages/opencode/src/tool/bash.ts@@ -4,25 +4,6 @@ import DESCRIPTION from "./bash.txt"import { App } from "../app/app"const MAX_OUTPUT_LENGTH = 30000-const BANNED_COMMANDS = [- "alias",- "curl",- "curlie",- "wget",- "axel",- "aria2c",- "nc",- "telnet",- "lynx",- "w3m",- "links",- "httpie",- "xh",- "http-prompt",- "chrome",- "firefox",- "safari",-]const DEFAULT_TIMEOUT = 1 * 60 * 1000const MAX_TIMEOUT = 10 * 60 * 1000@@ -45,8 +26,6 @@ export const BashTool = Tool.define({}),async execute(params, ctx) {const timeout = Math.min(params.timeout ?? DEFAULT_TIMEOUT, MAX_TIMEOUT)- if (BANNED_COMMANDS.some((item) => params.command.startsWith(item)))- throw new Error(`Command '${params.command}' is not allowed`)const process = Bun.spawn({cmd: ["bash", "-c", params.command],