Conversation
zastrowm
commented
Apr 23, 2026
- Create OVHcloud AI Endpoints community documentation (Create OVHcloud AI Endpoints community documentation strands-agents/docs#335)
- docs(hooks): document exception property on AfterToolCallEvent (docs(hooks): document exception property on AfterToolCallEvent strands-agents/docs#482)
- docs: rename StructuredOutputException to StructuredOutputError for TypeScript SDK (docs: rename StructuredOutputException to StructuredOutputError for TypeScript SDK strands-agents/docs#690)
- docs: update TypeScript SDK import paths for model subpath exports (docs: update TypeScript SDK import paths for model subpath exports strands-agents/docs#694)
- docs: update OpenAI TypeScript examples from gpt-4o to gpt-5.4 (docs: update OpenAI TypeScript examples from gpt-4o to gpt-5.4 strands-agents/docs#697)
- fix: convert metrics output section to collapsible details/summary (fix: convert metrics output section to collapsible details/summary strands-agents/docs#699)
- docs: update Kiro references (docs: update Kiro references strands-agents/docs#702)
- docs: add getTracer custom spans example to traces page (docs: add getTracer custom spans example to traces page strands-agents/docs#700)
- feat: add extension template docs (feat: add extension template docs strands-agents/docs#704)
- docs: add TypeScript coverage to contribute, examples sections (docs: add TypeScript coverage to contribute, examples sections strands-agents/docs#707)
- docs: update user guide for TypeScript SDK 1.0 RC (docs: update user guide for TypeScript SDK 1.0 RC strands-agents/docs#708)
- docs: add strands-google and strands-perplexity to community tools (docs: add strands-google and strands-perplexity to community tools strands-agents/docs#688)
- docs: update A2AExpressServer import path to sdk/a2a/express (docs: update A2AExpressServer import path to sdk/a2a/express strands-agents/docs#695)
- docs: add TypeScript vended tools documentation (docs: add TypeScript vended tools documentation strands-agents/docs#685)
- feat(telemetry): add local trace docs (feat(telemetry): add local trace docs strands-agents/docs#705)
- feat: vercel model provider (feat: vercel model provider strands-agents/docs#689)
- feat: redesign homepage with code-forward developer experience (feat: redesign homepage with code-forward developer experience strands-agents/docs#683)
- docs: update Tools overview and Agent as tool multi agent page with A… (docs: update Tools overview and Agent as tool multi agent page with A… strands-agents/docs#713)
- feat: design doc for stateful model providers (feat: design doc for stateful model providers strands-agents/docs#712)
- docs: add OpenAI Responses API model provider page (docs: add OpenAI Responses API model provider page strands-agents/docs#719)
- Remove community flag from get-featured.mdx (Remove community flag from get-featured.mdx strands-agents/docs#720)
- docs(team): Add AGENT_GUIDELINES.md — conventions for agents on Stran… (docs(team): Add AGENT_GUIDELINES.md — conventions for agents on Stran… strands-agents/docs#656)
- Fix broken samples links (Fix broken samples links strands-agents/docs#722)
- ignore log output files (ignore log output files strands-agents/docs#724)
- docs: apply prettier to typescript snippets; add ts summarization-conversation-manager in user guide (docs: add ts summarization-conversation-manager in user guide strands-agents/docs#709)
- docs: add Agent SOP blog post structure and authors (docs: add Agent SOP blog post structure and authors strands-agents/docs#723)
- feat(blog): add Model-Driven Approach blog post (feat(blog): add Model-Driven Approach blog post strands-agents/docs#730)
- feat: add TypeScript SDK announcement blog post (feat: add TypeScript SDK announcement blog post strands-agents/docs#741)
- docs: add Agent SOP references to prompts page (docs: add Agent SOP references to prompts page strands-agents/docs#743)
- docs: add wire-safe serialization section for TypeScript streaming events (docs: add wire-safe serialization section for TypeScript streaming events strands-agents/docs#693)
- docs: add documentation for TS agent-as-tool and agent.cancel() (docs: add documentation for TS agent-as-tool and agent.cancel() strands-agents/docs#744)
- docs: add state machine design doc (0005) (docs: add state machine design doc (0005) strands-agents/docs#731)
- feat(blog): add Claude 4 interleaved thinking blog post (feat(blog): add Claude 4 interleaved thinking blog post strands-agents/docs#737)
- feat(blog): add Physical AI blog post (feat(blog): add Physical AI blog post strands-agents/docs#739)
- feat(community): add s3-vectors-memory plugin (feat(community): add s3-vectors-memory plugin strands-agents/docs#740)
- docs: add Strands Agents 1.0 blog post (docs: add Strands Agents 1.0 blog post strands-agents/docs#738)
- docs: add TypeScript API references alongside Python links (docs: add TypeScript API references alongside Python links strands-agents/docs#747)
- docs: update note formatting for default inference model (docs: update note formatting for default inference model strands-agents/docs#729)
- feat(community/tools): add strands-sql — multi-dialect SQL tool for Strands Agents (feat(community/tools): add strands-sql — multi-dialect SQL tool for Strands Agents strands-agents/docs#751)
- Update Graph Import in session-management.mdx (Update Graph Import in session-management.mdx strands-agents/docs#710)
- docs(designs): cedar auth plugin (docs(designs): cedar auth plugin strands-agents/docs#732)
- fix: remove headings inside tabs that created broken table of content links (fix: remove headings inside tabs that created broken table of content links strands-agents/docs#760)
- docs(bidi): migrate stop_conversation to strands_tools.stop and request_state (docs(bidi): migrate stop_conversation to strands_tools.stop and request_state strands-agents/docs#696)
- docs: add correctness, goal success rate, coherence evaluator examples (docs: add correctness, goal success rate, coherence evaluator examples strands-agents/docs#714)
- docs: add required frontmatter guide for community catalog pages (docs: add required frontmatter guide for community catalog pages strands-agents/docs#753)
- feat: add multiagent session manager doc (feat: add multiagent session manager doc strands-agents/docs#764)
- docs(designs): interventions primitive (docs(designs): interventions primitive strands-agents/docs#763)
- fix: update ci for monorepo path (fix: update ci for monorepo path strands-agents/docs#773)
- docs: add Ollama example to Vercel TS provider page (docs: add Ollama example to Vercel TS provider page strands-agents/docs#771)
- docs(simulator): updated tool_simulator docs (docs(simulator): updated tool_simulator docs strands-agents/docs#752)
- docs: add TypeScript examples to interrupts documentation
…ds-agents#482) Co-authored-by: Charles Duffy <charles-dyfis-net@users.noreply.github.com>
…trands-agents#699) Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>
…trands-agents#688) Co-authored-by: agent-of-mkmeral <agent-of-mkmeral@users.noreply.github.com>
Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
strands-agents#713) Co-authored-by: Owen Kaplan <okapl@amazon.com>
strands-agents#656) Co-authored-by: Containerized Agent <agent@containerized-strands.local>
…versation-manager in user guide (strands-agents#709) Co-authored-by: Owen Kaplan <okapl@amazon.com>
Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>
Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ents (strands-agents#693) Co-authored-by: agent-of-mkmeral <agent-of-mkmeral@users.noreply.github.com> Co-authored-by: mkmeral <mkmeral@users.noreply.github.com> Co-authored-by: agent-of-mkmeral <217235299+strands-agent@users.noreply.github.com> Co-authored-by: Murat Kaan Meral <muratkaanmeral@gmail.com>
…gents#747) Co-authored-by: agent-of-mkmeral <217235299+strands-agent@users.noreply.github.com>
…st_state (strands-agents#696) Co-authored-by: agent-of-mkmeral <agent-of-mkmeral@users.noreply.github.com>
strands-agents#714) Co-authored-by: Kang Zhou <kangzhou1991@gmail.com> Co-authored-by: Subramanian Chidambaram <subbu10123@gmail.com>
…ands-agents#753) Co-authored-by: agent-of-mkmeral <agent-of-mkmeral@users.noreply.github.com>
Co-authored-by: Gautam Sirdeshmukh <gsird@amazon.com>
Documentation Preview FailedThe documentation deployment encountered an error. Please check the deployment logs for more details. |
|
Issue: This PR includes unrelated file deletions that should be in separate PRs. Three files are modified/deleted that have nothing to do with TypeScript interrupt documentation:
Suggestion: Per CONTRIBUTING.md: "please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change." These deletions should be reverted from this PR and submitted separately with their own justification. |
| </Tab> | ||
| <Tab label="TypeScript"> | ||
|
|
||
| Both `BeforeToolCallEvent` and `BeforeToolsEvent` are interruptible. Interrupting on a `BeforeToolCallEvent` allows users to intercept individual tool calls before execution, while `BeforeToolsEvent` allows intercepting the entire batch of tool calls before any execute. |
There was a problem hiding this comment.
Issue: The mdx mentions BeforeToolsEvent as a TS-specific interruptible event but the code example only demonstrates BeforeToolCallEvent. Since BeforeToolsEvent is called out as a distinguishing TypeScript capability (batch interception), it would be helpful to show it in action — even a brief snippet.
Suggestion: Add a small BeforeToolsEvent example to the hooks snippet (or a separate snippet) to demonstrate batch-level interruption, since this is a feature Python doesn't have and readers will want to see how it works.
| @@ -0,0 +1,199 @@ | |||
| // @ts-nocheck | |||
There was a problem hiding this comment.
Issue: With @ts-nocheck, none of this code is type-checked, so API signatures, import paths, and property names could silently drift from the actual SDK. This is understandable since the interrupt feature isn't published yet, but it creates a maintenance risk.
Suggestion: Add a TODO or tracking comment noting that @ts-nocheck should be removed once the interrupt feature is published in the SDK, so it gets picked up in a follow-up pass. Something like:
// @ts-nocheck
// TODO: Remove @ts-nocheck once interrupts ship in @strands-agents/sdk|
|
||
| Strands enforces the following rules for interrupts: | ||
|
|
||
| <Tabs> |
There was a problem hiding this comment.
Issue: The Rules sections for Hooks and Tools have significant content duplication between the Python and TypeScript tabs (3 out of 5 bullet points are identical). When the shared rules change, both tabs need to be updated independently, which is error-prone.
Suggestion: Consider keeping the shared rules outside the Tabs and only tabbing the SDK-specific differences. For example:
### Rules
Strands enforces the following rules for interrupts:
- All hooks configured on the interrupted event will execute
- All hooks configured on the interrupted event are allowed to raise an interrupt
- A single hook can raise multiple interrupts but only one at a time
<Tabs>
<Tab label="Python">
- All tools running concurrently are interruptible
- All tools running concurrently that are not interrupted will execute
</Tab>
<Tab label="TypeScript">
- When an interrupt fires mid-batch, completed tool results are preserved...
- Both assistant and tool result messages are appended only after...
</Tab>
</Tabs>| reason: { paths: (event.toolUse.input as { paths: string[] }).paths }, | ||
| }) | ||
| if (approval.toLowerCase() !== 'y') { | ||
| event.cancel = 'User denied permission to delete files' |
There was a problem hiding this comment.
Issue: The cancel property is introduced without much explanation of its type behavior. The mdx says "Set to true for a default message or provide a custom cancellation message string" but the code example only shows the string variant (event.cancel = 'User denied permission to delete files').
Suggestion: Consider briefly showing both variants in the hooks example comment or in the Components section so readers can see the true shorthand:
event.cancel = true // default cancellation message
// OR
event.cancel = 'User denied permission to delete files' // custom message| let result = await agent.invoke(`paths=<${JSON.stringify(paths)}>`) | ||
|
|
||
| while (result.stopReason === 'interrupt') { | ||
| const responses = result.interrupts!.map((interrupt) => ({ |
There was a problem hiding this comment.
Issue: The Python hooks example shows filtering interrupts by name (if interrupt.name == "myapp-approval") in the response loop, but the TypeScript hooks example doesn't — it responds to all interrupts unconditionally with result.interrupts!.map(...). This makes the TS example less complete as a real-world pattern since in practice you'd typically check the interrupt name.
Suggestion: Add a name check in the TypeScript response loop to match the Python example's pattern and show readers the recommended practice:
const responses = result.interrupts!
.filter((i) => i.name === 'myapp-approval')
.map((interrupt) => ({
interruptResponse: {
interruptId: interrupt.id,
response: 'y',
},
}))| if (event.toolUse.name !== 'delete_files') return | ||
|
|
||
| // Check if user already trusted this approval | ||
| if (event.agent.appState.get('myapp-approval') === 't') return |
There was a problem hiding this comment.
Issue: The session management example uses event.agent.appState.get('myapp-approval') and event.agent.appState.set(...) but the type annotation on server's prompt parameter uses { interruptResponse: { interruptId: string; response: unknown } }[]. Since this is @ts-nocheck, the type won't be validated, but consider whether unknown is the right type for response here — the mdx says "must be JSON-serializable".
Minor: also, event.agent.appState is accessed within a hook callback — ensure this access pattern (event.agent) is the actual SDK API rather than, say, requiring a separate agent reference. With @ts-nocheck this won't be caught if wrong.
|
Assessment: Request Changes This PR adds well-structured TypeScript examples to the interrupts documentation, following established patterns (snippet markers, Tabs/Tab components, function scoping). The examples cover hooks, tools, and session management — the core interrupt workflows. Review Categories
The interrupt documentation additions are a solid contribution and the TS examples closely mirror the Python patterns. |