Skip to content

Commit 35f6565

Browse files
committed
fix: improve windows shell compatibility
1 parent efac6e6 commit 35f6565

5 files changed

Lines changed: 1171 additions & 27 deletions

File tree

core/prompts/system_default.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Use the right tool for each job:
3232
| Search the web | `web_search` |
3333
| Delegate a sub-task | `task` |
3434

35+
Platform note for shell usage:
36+
37+
- On Windows, the `bash` tool runs commands through PowerShell, not GNU bash.
38+
- Prefer PowerShell-native syntax on Windows.
39+
- For HTTP probing on Windows, prefer `curl.exe` or `Invoke-RestMethod`. Do not assume Unix-only patterns like bare `GET <url>`, `grep`, `sed`, `awk`, `tail -f`, or `cmd1 && cmd2` will work unless you explicitly translate them to PowerShell.
40+
3541
## Completion Criteria
3642

3743
You are done when **all** of the following are true:

core/skills/builtin-tools.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ tools:
8585
- diff
8686

8787
- name: bash
88-
description: Execute a bash command in the workspace directory. Use for running commands, installing packages, running tests, etc.
88+
description: Execute a shell command in the workspace directory. On Windows this runs in PowerShell, not GNU bash. Use for running commands, installing packages, running tests, and local diagnostics.
8989
backend:
9090
type: builtin
9191
parameters:
9292
type: object
9393
properties:
9494
command:
9595
type: string
96-
description: The bash command to execute
96+
description: The shell command to execute. On Windows, write PowerShell-compatible commands by default. A limited compatibility shim exists for curl, wget, bare HTTP verbs (GET/POST/PUT/PATCH/DELETE/OPTIONS), which, and head.
9797
timeout:
9898
type: integer
9999
description: Timeout in milliseconds (default 120000)
@@ -258,6 +258,14 @@ Core file operation and shell tools for A3S Code.
258258
## When to Use box vs bash
259259

260260
- Use **bash** for normal workspace operations (read files, run tests, build code)
261+
262+
## Windows Shell Rules
263+
264+
- On Windows, the **bash** tool executes the command through **PowerShell**, not GNU bash and not `cmd.exe`.
265+
- Prefer native PowerShell syntax on Windows.
266+
- For HTTP calls on Windows, prefer `curl.exe` or `Invoke-RestMethod`. A compatibility shim also accepts `curl`, `wget`, and bare verbs like `GET http://127.0.0.1:18790/health`.
267+
- Do not assume Unix utilities or GNU shell behavior on Windows. Avoid patterns like `grep`, `sed`, `awk`, `tail -f`, `cmd1 && cmd2`, or bash-specific quoting unless you explicitly convert them to PowerShell syntax.
268+
- If you need to inspect only the first few output lines in PowerShell, prefer `Select-Object -First N`. The compatibility shim also supports `head -N`.
261269
- Use **box** when you need:
262270
- VM-level isolation from the host
263271
- Safe execution of untrusted or experimental code

0 commit comments

Comments
 (0)