Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,100 @@ Unreleased changes live in [`changelog.d/`](changelog.d/README.md), one file per

## [Unreleased]

## [2.41.0] - 2026-11-29

### Changed

- **`shell_exec` and `shell_write_stdin` return a dict instead of text** (`tools/shell_tools.py`). The text they
returned is now the `rendered` field, with a final "❌ …" line on a failure and a note when the session has no
pipefail: code that used the returned string reads `result["rendered"]`, and a host tests `result["success"]`
instead of reading the text. `shell_close` still returns text.
- `shell_exec` returns `success`, `error` (a short sentence on failure, else null), `command`, `session_id`,
`return_code` and `exit_code` (the same value), `pipefail`, `timed_out`, `session_ended`, `not_run`,
`output_truncated`, `rendered` and, under a sandbox, `sandbox`.
- `success` is false on a non-zero exit, on an exit code that could not be read, on a timeout, and when the
command ended the session's shell (`exit 3`, `set -e` then a failure, a sourced script that exits; `exit 0` too,
since the session's state is lost): "The shell session ended during this command (exit code N)", with the signal
named when one killed it.
- As in 2.40.0, the call waits `timeout` seconds, at most 600 and at least 1; 0, a negative or a non-numeric
value means 120.
- A refusal (an empty command, no sandbox, a session that could not start, a session closed because it could not
be resynchronised after a timed-out command) is `{success: false, error, command, rendered}`.
- `shell_write_stdin` returns `success`, `error`, `session_id`, `return_code` / `exit_code` (null unless the input
ended the shell), `session_ended`, `output_truncated` and `rendered`. Input that ends the shell (`exit 3`) is a
failure, and a refusal (no active session, a failed write) is `{success: false, error, session_id, rendered}`.
- **A failed `execute_command` says "Command failed"** (`tools/common_tools.py`, `tools/command_verdict.py`). A
non-zero exit ends `rendered` with "❌ Command failed (exit code N)" and sets `error` to "Command failed (exit
code N)", where both read "Command completed with non-zero exit code: N"; `success` is false as before. Code that
matched the old sentence tests `success` or `return_code`. The result names the signal when one killed the shell,
says "(no output)" when there was none, and has a new `pipefail` field (see Fixed).
- **The descriptions the model reads for `execute_command`, `shell_exec` and `shell_write_stdin` are rewritten**, so
a stored copy of these tool definitions (a prompt snapshot, a test fixture) differs from 2.40.0's.
- On macOS and Linux, `execute_command` and `shell_exec` say that pipelines use pipefail, tell the model never to
pipe into `head` (`execute_command` adds that output is already previewed), and show how to keep a grep test
from hiding a failure: `cmd | { grep pat || [ $? -eq 1 ]; }` accepts no match (grep's own errors still fail),
and `cmd | { grep pat >/dev/null && echo y || echo n; }` tests for a match.
- On Windows, `execute_command`'s description, guidance and examples are the `cmd.exe` ones: no pipefail promise
and no POSIX grouping syntax.
- `shell_exec` tells the model not to run a command that prompts (`read -p`, a `[Y/n]` confirmation) without
giving its answer in the command (`echo y | cmd`). The tool's status line waits in the terminal's input queue
while the command runs, so the prompt reads that line as its answer and carries on, and the call then waits out
its timeout. `shell_write_stdin` and the timeout message say that only a process still waiting for input (a
REPL, a later prompt of the same command) can be fed.
- **AbstractVision 0.3.39 is the floor** (base dependency, the `apple` / `gpu` settings and the `vision-*` aliases;
it was 0.3.37). On Apple silicon, `abstractcore[apple]` now installs MLX-Gen 0.40.4 or later
(`mlx-gen>=0.40.4,<0.41`); `mlx>=0.32.4` is unchanged. With MLX-Gen 0.40.3 or earlier (AbstractVision 0.3.37 and
0.3.38 accepted 0.40.1 to 0.40.3), no Bonsai image generation could complete. AbstractVision 0.3.39 also lists
the Bonsai binary 1-bit checkpoint (`prism-ml/bonsai-image-binary-4B-mlx-1bit`) as its own model. AbstractCore's
vision routes and vision Python API are unchanged. An existing Apple install gets MLX-Gen 0.40.4 with
`pip install -U "abstractcore[apple]"`. With `[gpu]` or no extra, the same command only moves AbstractVision to
0.3.39: neither installs MLX-Gen.

### Fixed

- **A failing command in a pipeline fails `execute_command` and `shell_exec`** (`tools/common_tools.py`,
`tools/command_verdict.py`, `tools/sandbox.py`, `tools/shell_session.py`, `tools/shell_tools.py`). Commands ran
in `/bin/sh` without pipefail, so a pipeline reported its last stage's status: `cargo build 2>&1 | grep -E
'^error' | head -60` failed to build and the tool said "Return code: 0" and "Command completed successfully".
- `execute_command` on macOS and Linux: a command given as a string, sandboxed or not, runs in
`/bin/sh -o pipefail -c` when that shell supports it (macOS, where `/bin/sh` is bash; Ubuntu's dash 0.5.12),
else in `bash --posix -o pipefail -c`, else in plain `/bin/sh -c`. The choice is probed once per process; a
probe that gave no answer is not remembered. Neither shell reads `$BASH_ENV`. The result's `pipefail` field
says whether pipefail was on, and the rendered text says so when it was not.
- `execute_command` on Windows: the command still runs in `cmd.exe` (the Windows sandbox runs a string command
through its own launcher as before), which has no pipefail. `pipefail` is false and every finished command's
result says that a pipeline reports its last command's exit code.
- `shell_exec`: each session turns pipefail on at start, measures it in the session itself and turns it back on
after every command and after a timeout. A shell that refuses it (for example after `exec dash`) is then
reported as having none, and an unfinished measurement as unknown.
- Exit 141 is explained in the result: a process killed by SIGPIPE, usually cut off by a stage such as `head`
that stopped reading.
- **A long failing output keeps its end** (`tools/command_verdict.py`). The preview of a failing `execute_command`
keeps the head and the tail of its output, since a failing command usually says why at the end (a successful one
keeps its head, as before); `stdout` and `stderr` are still returned in full. A long failing or timed-out
`shell_exec` output keeps its head and its latest output; omitted counts are on the normalised text.
- **`shell_exec` reports the status of the command it ran** (`tools/shell_session.py`). Each command runs in a
`{ … }` group read as a whole.
- A command line left open (a trailing `&&`, `||` or `|`, an unclosed `if` or quote) fails at once with a syntax
error instead of reporting the previous call's status; a trailing `\` keeps its status.
- Nothing the command defines (`exit() { :; }`, an alias) can change the reported status; an alias defined in a
call applies from the next call.
- History expansion is off (`!` is literal) and completion is off (a TAB reaches the command).
- **A shell that ends while a timed-out command is being interrupted is reported as ended**
(`tools/shell_session.py`). The `shell_exec` call that follows a timeout first interrupts the session. When the
shell ends during that interrupt (the timed-out command was `exec sleep 100`, an INT trap exits, the shell exits
by itself, or the session is closed from elsewhere), the call reports an ended session with the shell's exit
code or signal when known, `not_run: true`, and an error saying its command was not run.
- **On Linux, a shell session is kept after a timed-out command that has ended on its own**
(`tools/shell_session.py`). The `shell_exec` call that follows a timeout interrupts the session and waits for a
marker line. When the timed-out command was no longer running (it finished late, or its prompt had read the
tool's status line and carried on) or was waiting in the shell's `read`, the shell reading the terminal lost
the start of the marker line (bash) or the whole line (dash), on each of the three attempts. Since 2.40.0 that
call failed after 15 seconds with "could not be resynchronised … (its foreground process kept running through 3
interrupts)" although nothing was running, and the session was closed with its working directory and
environment. A no-op line now precedes the marker line, so the call runs in the same session. macOS was not
affected.

## [2.40.0] - 2026-11-27

### Added
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Unified LLM Interface
> Write once, run everywhere

What's new in 2.41.0: the agent tools `execute_command` and `shell_exec` report a pipeline as failed when any of its commands fails (pipelines run with pipefail on macOS and Linux), so a build that fails behind `| grep` or `| head` is no longer reported as a success; `shell_exec` and `shell_write_stdin` return a dict with `success` and `rendered` instead of text (code that used the returned string reads `rendered`); on Linux a shell session is no longer closed when its timed-out command had already ended on its own; AbstractVision 0.3.39 is the oldest version installed (with the `apple` setting, MLX-Gen 0.40.4 or later). See [CHANGELOG.md](CHANGELOG.md#2410---2026-11-29).

What's new in 2.40.0: the server's vision routes take a memory mode (`default`, `low`, `lowest`), a load-time `quantize` and, for MiniMax-H3, soundtrack fields; discovery lists each model's memory modes, sound support and measured memory peaks; a running generation job can be cancelled; responses carry no filesystem paths and every error has an `error.code`. See [CHANGELOG.md](CHANGELOG.md#2400---2026-11-27).

What's new in 2.39.0: on Windows, agents' shell commands run inside the command sandbox under every workspace setting ("Allow everything, refuse listed workspaces" read & write or read-only by default, and "Deny everything, allow listed workspaces"); a drive that stores no permissions (exFAT, FAT, a network share) is named in each command's result as not protected. In 2.38.0: the first Windows sandbox, for the read & write default. See the [changelog](CHANGELOG.md#2390---2026-11-25).
Expand Down
2 changes: 1 addition & 1 deletion abstractcore/utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"""

# Package version - update this when releasing new versions
__version__ = "2.40.0"
__version__ = "2.41.0"
61 changes: 0 additions & 61 deletions changelog.d/execute-command-pipefail.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,8 @@ Every vision error body has `error.code` (`invalid_request`, `not_found`,
`conflict`, `capability_not_supported`, `validation_error`, `server_error`, ...),
and `error.field` when one field is at fault. A local engine that is missing,
or installed outside the versions the installed AbstractVision requires (MLX-Gen:
`mlx-gen>=0.40.1,<0.41` with AbstractVision 0.3.37, `mlx-gen>=0.40.3,<0.41` from 0.3.38,
and, on macOS, `mlx>=0.32.4`), is `501` (`not_implemented`) with AbstractVision's
`mlx-gen>=0.40.4,<0.41` with AbstractVision 0.3.39, the oldest version AbstractCore
installs with, and, on macOS, `mlx>=0.32.4`), is `501` (`not_implemented`) with AbstractVision's
message naming the versions to install. An unexpected engine error is `500`
with its type only; the server log has its message.

Expand Down
3 changes: 2 additions & 1 deletion docs/tool-calling.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ the same command. Once a call has timed out on a first prompt, nothing is waitin
`shell_write_stdin` returns
`success`, `error`, `session_id`, `return_code`/`exit_code` (null unless the input ended the
shell), `session_ended`, `output_truncated` and `rendered`; its refusal (no active session, a
failed write) is `{success: false, error, session_id, rendered}`. Sessions run pipelines with pipefail
failed write) is `{success: false, error, session_id, rendered}`. `shell_close` returns one sentence of
text saying whether a session was closed. Sessions run pipelines with pipefail
and turn it back on after every command and after a timeout; a shell that refuses it (for example
after `exec dash`) is then reported as having none. A long failing or timed-out output keeps its
head and its tail.
Expand Down
Loading
Loading