Skip to content

Commit 6567db7

Browse files
committed
fix(exec-command): clarify tty semantics
1 parent 59e12e0 commit 6567db7

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

src/crates/assembly/core/src/agentic/tools/implementations/exec_command/command.rs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -773,14 +773,21 @@ impl Tool for ExecCommandTool {
773773
}
774774

775775
async fn description(&self) -> BitFunResult<String> {
776-
Ok(r#"Runs a shell command.
777-
778-
Each call starts a separate process.
779-
Use tty=true only for commands that need interactive stdin; otherwise leave tty=false.
780-
yield_time_ms waits for output until the process exits or the deadline is reached. It does not stop the process.
781-
If the process is still running, the result includes a numeric session_id. Use WriteStdin to poll for more output or send input to tty=true sessions, and ExecControl to interrupt or kill it.
782-
Output is only what was produced during this tool call's wait window.
783-
With tty=false, stdout and stderr ordering is not guaranteed; use tty=true or redirect stderr with 2>&1 when terminal ordering matters."#
776+
Ok(r#"Runs a shell command in a separate process.
777+
778+
TTY and stdin:
779+
- tty=true allocates a PTY and gives the command terminal semantics. Use tty=true only for commands that need interactive stdin.
780+
- tty=false runs without a PTY. Locally this uses pipe-backed stdio; remotely it uses a non-PTY SSH exec channel.
781+
- With tty=false, no interactive stdin is attached, and input-waiting programs may see EOF instead of a prompt.
782+
783+
Waiting and continuation:
784+
- yield_time_ms waits for output until the process exits or the deadline is reached. It does not stop the process.
785+
- If the process is still running after `yield_time_ms`, the result includes a numeric session_id.
786+
- Use WriteStdin to poll for more output or send input to tty=true sessions, and ExecControl to interrupt or kill it.
787+
788+
Output:
789+
- Output is only what was produced during this tool call's wait window.
790+
- With tty=false, stdout and stderr ordering is not guaranteed; use tty=true or redirect stderr with 2>&1 when terminal ordering matters."#
784791
.to_string())
785792
}
786793

@@ -813,7 +820,7 @@ With tty=false, stdout and stderr ordering is not guaranteed; use tty=true or re
813820
},
814821
"yield_time_ms": {
815822
"type": "number",
816-
"description": "How long to wait for output before yielding. This does not stop the process."
823+
"description": "How long to wait for output before yielding."
817824
},
818825
"max_output_chars": {
819826
"type": "number",

src/crates/assembly/core/src/agentic/tools/implementations/exec_command/control.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ impl Tool for ExecControlTool {
382382
383383
Pass the session_id returned by ExecCommand.
384384
Use action="interrupt" when a command should stop gracefully, like pressing Ctrl+C. Use action="kill" when the process must be terminated.
385-
After the action, yield_time_ms waits for output or exit status. Output is only what was produced during this tool call's wait window."#
385+
After the action, yield_time_ms waits for output or exit status.
386+
Output is only what was produced during this tool call's wait window."#
386387
.to_string())
387388
}
388389

@@ -396,7 +397,7 @@ After the action, yield_time_ms waits for output or exit status. Output is only
396397
"properties": {
397398
"session_id": {
398399
"type": "number",
399-
"description": "session_id returned by ExecCommand while a process is still running."
400+
"description": "session_id returned by ExecCommand."
400401
},
401402
"action": {
402403
"type": "string",

0 commit comments

Comments
 (0)