Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix(agent-tools): de-duplicate bash timeout/background doc (#9154)

Akarshan Biswas3a197767c950
diff --git a/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/handlers.rs b/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/handlers.rs
index 3dc916f15..a689202f1 100644
--- a/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/handlers.rs
+++ b/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/handlers.rs
@@ -1008,7 +1008,8 @@ async fn bash(args: &serde_json::Value, ctx: &ToolContext<'_>) -> String {
// never end.
format!(
" You do not have to wait or poll for it: you are notified \
- automatically when it finishes, so carry on with other work. \
+ automatically when it finishes, so carry on with other work \
+ or end your turn. \
If it is still running after about {}s you are told that \
instead, and the run is free to end -- the file still appears \
when the command eventually finishes.",
diff --git a/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/schema.rs b/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/schema.rs
index b58613b3b..1a3617186 100644
--- a/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/schema.rs
+++ b/src-tauri/plugins/tauri-plugin-agent-tools/src/tools/schema.rs
@@ -10,7 +10,7 @@
use serde_json::{json, Value};
/// The `bash` tool's description before any shell-specific note.
-const BASH_DESCRIPTION: &str = "Run a shell command in the project root. Returns combined stdout and stderr, followed by a final `[exit N]` line (or `[terminated by signal]`). Judge success by that exit code, not by whether there is text on stderr: many commands (e.g. `git push`) write normal status to stderr on success, so `[exit 0]` means it worked. The output is COMPLETE and verbatim: trust it and do not re-run a command to double-check. It is truncated only when it exceeds 2000 lines or 64KB, and only then is an explicit `[output truncated ...]` notice appended with a temp-file path holding the full output; when truncated the LAST lines are kept (so the final result and errors stay visible). Absent that notice, you have the full output. If the command doesn't finish within `timeout` seconds (default 30), it keeps running in the background instead of erroring or being killed, and this call returns the path to a file where its full output will be written once it finishes; read that file (with the read tool) to collect the result. The file appears only when the command is done, so its presence means the output is complete.";
+const BASH_DESCRIPTION: &str = "Run a shell command in the project root. Returns combined stdout and stderr, followed by a final `[exit N]` line (or `[terminated by signal]`). Judge success by that exit code, not by whether there is text on stderr: many commands (e.g. `git push`) write normal status to stderr on success, so `[exit 0]` means it worked. The output is COMPLETE and verbatim: trust it and do not re-run a command to double-check. It is truncated only when it exceeds 2000 lines or 64KB, and only then is an explicit `[output truncated ...]` notice appended with a temp-file path holding the full output; when truncated the LAST lines are kept (so the final result and errors stay visible). Absent that notice, you have the full output.";
/// The `bash` description for a shell of `kind`. The model writes POSIX by
/// default, so a PowerShell or cmd host says so up front rather than letting the