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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,14 @@
1
1
# Changelog
2
2
3
+
## 0.84.0 (2026-04-07)
4
+
5
+
Full Changelog: [sdk-v0.83.0...sdk-v0.84.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.83.0...sdk-v0.84.0)
6
+
7
+
### Features
8
+
9
+
***api:** Add support for claude-mythos-preview ([d4057b0](https://github.com/anthropics/anthropic-sdk-typescript/commit/d4057b0a9559d9a620e6a398a4199f5a416bc7a6))
10
+
***tools:** add AbortSignal support for tool runner ([#848](https://github.com/anthropics/anthropic-sdk-typescript/issues/848)) ([972d591](https://github.com/anthropics/anthropic-sdk-typescript/commit/972d5918a4d24b15686c8c407860cbfed4215ffa))
11
+
3
12
## 0.83.0 (2026-04-03)
4
13
5
14
Full Changelog: [sdk-v0.82.0...sdk-v0.83.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.82.0...sdk-v0.83.0)
Copy file name to clipboardExpand all lines: helpers.md
+60-2Lines changed: 60 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,6 +256,48 @@ console.log(await runner);
256
256
See [`examples/tools-helpers-advanced-streaming.ts`](examples/tools-helpers-advanced-streaming.ts) for a more
257
257
in-depth example.
258
258
259
+
#### Cancellation
260
+
261
+
The `BetaToolRunner` supports cancellation via `AbortSignal`. The signal is passed to both API calls and tool `run` methods via the `BetaToolRunContext`.
262
+
263
+
```ts
264
+
constcontroller=newAbortController();
265
+
266
+
construnner=anthropic.beta.messages.toolRunner(
267
+
{
268
+
model: 'claude-sonnet-4-5-20250929',
269
+
max_tokens: 1000,
270
+
messages: [{ role: 'user', content: 'Do a long task' }],
271
+
tools: [
272
+
betaZodTool({
273
+
name: 'long_task',
274
+
inputSchema: z.object({ query: z.string() }),
275
+
description: 'A long-running task',
276
+
run: async (input, context) => {
277
+
// Throws AbortError if already cancelled before run() was called
278
+
context?.signal?.throwIfAborted();
279
+
// Pass the signal to downstream operations for mid-flight cancellation
280
+
const result =awaitfetch(url, { signal: context?.signal });
281
+
returnresult.text();
282
+
},
283
+
}),
284
+
],
285
+
},
286
+
{ signal: controller.signal },
287
+
);
288
+
289
+
// Cancel after 5 seconds
290
+
setTimeout(() =>controller.abort(), 5000);
291
+
292
+
constfinalMessage=awaitrunner;
293
+
```
294
+
295
+
You can also set or update the signal after creating the runner:
Gets the tool response for the last assistant message (if any tools need to be executed).
449
+
Gets the tool response for the last assistant message (if any tools need to be executed). Accepts an optional `AbortSignal` parameter that will be passed to tool `run` methods; defaults to the signal from request options.
Copy file name to clipboardExpand all lines: packages/aws-sdk/CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,14 @@
1
1
# Changelog
2
2
3
+
## 0.2.2 (2026-04-07)
4
+
5
+
Full Changelog: [aws-sdk-v0.2.1...aws-sdk-v0.2.2](https://github.com/anthropics/anthropic-sdk-typescript/compare/aws-sdk-v0.2.1...aws-sdk-v0.2.2)
6
+
7
+
### Chores
8
+
9
+
***internal:** version bump ([eb97e85](https://github.com/anthropics/anthropic-sdk-typescript/commit/eb97e8577279fb150582297d2a0924a297185c3c))
10
+
***internal:** version bump ([8ebaf61](https://github.com/anthropics/anthropic-sdk-typescript/commit/8ebaf616d2e5c6aebc153f19a403dde41ab5a9f1))
11
+
3
12
## 0.2.1 (2026-04-03)
4
13
5
14
Full Changelog: [aws-sdk-v0.2.0...aws-sdk-v0.2.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/aws-sdk-v0.2.0...aws-sdk-v0.2.1)
0 commit comments