Features
-
api: add support for Claude Managed Agents on Amazon Bedrock
-
api: add the storage_not_ready error code
-
tools: add
max_concurrent_callsto the session tool runner and the environment workerWith a value above 1, or
Nonefor no limit, the calls of different session threads run concurrently. Calls still run one at a time by default.
Bug Fixes
-
environments: claim a work item before serving it and do not stop items whose lease was lost
- The poller's
auto_stopnow sends a force stop. handle_item()logs a failure instead of raising it if the lease was lost. It raises errors as they are, not in anExceptionGroup.- Memory files are also uploaded when the session goes idle, and the skills of subagents are downloaded too. Of two skills with one name, the first is kept (was the last).
- The poller's
-
tools: kill what the
bashtool's shell started, and save long output to a file- A timeout or a cancellation kills the shell and its background jobs. Once a shell has ended,
bashrefuses calls until one passesrestart. - A command may run for 295 seconds (was 120). Output is stdout and then stderr (stderr first for a failed command), cut after 30,000 characters (was the last 100 KiB), with the path of a file that has the rest.
readasks for aview_rangeabove 110,000 bytes (was 256 KiB).- Use
BashSession.start(), becauseBashSession()takes other arguments.
- A timeout or a cancellation kills the shell and its background jobs. Once a shell has ended,
-
tools: run only the session tool calls that the session is waiting on
- A running async tool is cancelled when the session no longer accepts its result or the runner stops. The tool timeout is 325 seconds (was 150).
bashkeeps one shell for each session thread.- A permanent API error from reading the session, such as the 404 for a deleted session, is raised.
- Async tools must shield what they await to clean up (
anyio.CancelScope(shield=True)), and run blocking work withanyio.to_thread.run_sync, which is awaited on a cancel.
-
tools: wait at most 150 seconds for a cancelled tool when the session tool runner stops
Performance Improvements
-
streaming: construct stream events directly instead of reflectively
-
structured outputs: generate a model's JSON schema once in
transform_schema()A model whose JSON schema changes after it is first passed to
transform_schema()keeps its first schema, as it already does withparse()andstream(). PassModel.model_json_schema()instead to generate the schema on every call.