From 3e436448ab072fab617ad89ce148e4b02b6ed7ff Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Thu, 17 Apr 2025 23:18:05 -0700 Subject: [PATCH] minor cleanup for background processes and prompt --- core/tools/definitions/runTerminalCommand.ts | 1 + core/tools/implementations/runTerminalCommand.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/tools/definitions/runTerminalCommand.ts b/core/tools/definitions/runTerminalCommand.ts index fa99ad700..73d326902 100644 --- a/core/tools/definitions/runTerminalCommand.ts +++ b/core/tools/definitions/runTerminalCommand.ts @@ -15,6 +15,7 @@ export const runTerminalCommandTool: Tool = { "Run a terminal command in the current directory.\ The shell is not stateful and will not remember any previous commands.\ When a command is run in the background ALWAYS suggest using shell commands to stop it; NEVER suggest using Ctrl+C.\ + When suggesting subsequent shell commands ALWAYS format them in shell command blocks.\ Do NOT perform actions requiring special/admin privileges.", parameters: { type: "object", diff --git a/core/tools/implementations/runTerminalCommand.ts b/core/tools/implementations/runTerminalCommand.ts index 4d484998c..8d2391561 100644 --- a/core/tools/implementations/runTerminalCommand.ts +++ b/core/tools/implementations/runTerminalCommand.ts @@ -116,7 +116,7 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { { name: "Terminal", description: "Terminal command output", - content: terminalOutput + (code === 0 + content: terminalOutput + (code === 0 || !code ? "\n[Background command completed]" : `\n[Background command failed with exit code ${code}]`), },