sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

[PORT] AfterToolsEvent hook

Open liramon2 opened this issue 4 months ago • 1 comments

Source SDK

strands-ts

Target SDK

strands-py

Related Files

strands-ts/src/hooks/events.ts
strands-ts/src/hooks/index.ts
strands-ts/src/agent/agent.ts
strands-ts/src/types/agent.ts
strands-ts/src/index.ts
strands-ts/src/__fixtures__/mock-plugin.ts
strands-ts/src/agent/__tests__/agent.test.ts
strands-ts/src/agent/__tests__/agent.hook.test.ts
site/src/content/docs/user-guide/concepts/agents/hooks.mdx
site/src/content/docs/user-guide/concepts/interrupts.mdx
site/src/content/docs/user-guide/concepts/streaming/async-iterators.mdx
site/src/content/docs/user-guide/concepts/streaming/index.mdx
site/src/content/docs/user-guide/concepts/tools/vended-tools.mdx

What needs to be migrated

TypeScript has a batch-level AfterToolsEvent hook that fires once after all tools in a batch complete; Python only has per-tool AfterToolCallEvent. The AfterToolsEvent gives hooks aggregate visibility over all tool results and enables early loop termination via its mutable endTurn field.

Confirmation

  • [x] The change is complete in the source SDK, and every related artifact is listed above (source, tests, and docs, if the change has any).

liramon2 avatar Jul 27 '26 16:07 liramon2

Merged into #3498 (combined BeforeToolsEvent + AfterToolsEvent into a single batch-hooks port issue).

liramon2 avatar Jul 27 '26 21:07 liramon2