You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cfd1a20
Browse filesBrowse the repository at this point in the historyBrowse files
Reads new output from a task started by shell with background=true or a script tool with mode=background.
2
+
3
+
Pass the exact taskid returned by the tool. The result contains only output produced since the previous read. If the task is still running, call read_task again later with the same taskid. If the process has exited, the result includes the final exit status.
Copy file name to clipboardExpand all lines: packages/sbot/prompts/tools/command/shell.txt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
Executes a shell command or multi-line shell script in a given working directory. Returns stdout and stderr separately. Default timeout 60 s.
2
2
3
+
Set background=true for commands that may take longer than a normal tool call, such as builds, test suites, servers, or long scripts. In background mode, the tool waits briefly for completion; if the process is still running, it returns current output plus a taskid. Use read_task with that taskid to read later output.
4
+
3
5
Supports all forms:
4
6
- Single command: "git status"
5
7
- Chained commands: "npm install && npm run build"
@@ -13,14 +18,35 @@ export function createShellTool(): StructuredToolInterface {
13
18
workingDir: z.string().describe('Absolute path of the working directory'),
14
19
stdin: z.any().optional().describe('Data to pipe into the command via stdin. Prefer a string; objects/arrays are auto-serialized to JSON.'),
15
20
timeout: z.number().optional().default(60000).describe('Timeout in milliseconds, default 60000 (60 s)'),
21
+
background: z.boolean().optional().default(false).describe('Run as a background task. If still running after yieldMs, returns existing output plus a taskid for read_task.'),
22
+
yieldMs: z.number().optional().default(1000).describe('Background mode only: how long to wait for immediate completion before returning a taskid, default 1000 ms'),
0 commit comments