From 295f9d6ff99943a1df535eaa32fdadecd9031f97 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Thu, 8 Jan 2026 23:13:36 -0500 Subject: [PATCH] Add guidance for terminal tool about being a pty (#46417) Release Notes: - N/A --- crates/agent/src/tools/terminal_tool.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/agent/src/tools/terminal_tool.rs b/crates/agent/src/tools/terminal_tool.rs index aaf7ea9ebb0c87979b7bce58ebaaaee1d0a1116f..09d92452abc165c60d2e4dece88fe6167b8615e0 100644 --- a/crates/agent/src/tools/terminal_tool.rs +++ b/crates/agent/src/tools/terminal_tool.rs @@ -35,6 +35,9 @@ const COMMAND_OUTPUT_LIMIT: u64 = 16 * 1024; /// For potentially long-running commands, prefer specifying `timeout_ms` to bound runtime and prevent indefinite hangs. /// /// Remember that each invocation of this tool will spawn a new shell process, so you can't rely on any state from previous invocations. +/// +/// The terminal emulator is an interactive pty, so commands may block waiting for user input. +/// Some commands can be configured not to do this, such as `git --no-pager diff` and similar. #[derive(Clone, Debug, Serialize, Deserialize, JsonSchema)] pub struct TerminalToolInput { /// The one-liner command to execute.