feat: batch TS updates including hooks updates, retries, multi-agent …#838
Conversation
…interrupts, timeouts on graphs, and small papercuts
Documentation Preview ReadyYour documentation preview has been successfully deployed! Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-cms-838/docs/user-guide/quickstart/overview/ Updated at: 2026-05-15T15:43:57.929Z |
- retry-strategies: clarify jitter only applies to Exponential/Linear backoff - conversation-management: name both should_truncate_results (Py) and shouldTruncateResults (TS) - amazon-bedrock: bump request-timeout example to claude-sonnet-4-6 - interrupts: drop broken @api/typescript links for unexported multi-agent types
| @@ -108,6 +108,8 @@ In TypeScript, the tool name and description are always provided explicitly in t | |||
| </Tab> | |||
| </Tabs> | |||
|
|
|||
There was a problem hiding this comment.
Issue: This note is placed outside the <Tabs> block, implying it applies to both Python and TypeScript. However, based on the linked PR (sdk-typescript/pull/1017), the INVALID_TOOL_NAME substitution behavior is TypeScript-specific.
Suggestion: Either wrap this in a TypeScript-only <Tab> block or explicitly qualify which SDK(s) enforce this constraint:
In TypeScript, tool names must match `^[a-zA-Z0-9_-]+$` and be 1 to 64 characters long. Names that do not match...| async function requestTimeoutExample() { | ||
| // --8<-- [start:request_timeout] | ||
| const bedrockModel = new BedrockModel({ | ||
| modelId: 'us.anthropic.claude-sonnet-4-6', |
There was a problem hiding this comment.
Issue: The modelId here uses us.anthropic.claude-sonnet-4-6 which is a cross-region inference profile. Given this is a "request timeout" example (not a cross-region example), a simpler model ID might reduce confusion for readers who are just learning to configure timeouts.
Suggestion: Consider using a base model ID like anthropic.claude-sonnet-4-20250514 to keep the example focused on the timeout configuration being demonstrated.
| ``` | ||
|
|
||
| Passing a fully-constructed handler instance (rather than an options bag) bypasses the default; the handler's own timeouts apply unchanged. | ||
|
|
There was a problem hiding this comment.
Issue: The statement "Passing a fully-constructed handler instance (rather than an options bag) bypasses the default; the handler's own timeouts apply unchanged" is potentially confusing. It contrasts with the code example above it which uses an options bag { requestTimeout: 60_000 }. A reader might wonder: "Wait, does the example above actually work then?"
Suggestion: Clarify that the example above is an options bag (which overrides the SDK's 120s default), and that this caveat applies to a different usage pattern (e.g., passing a NodeHttpHandler instance directly).
| void bedrockModel | ||
| } | ||
|
|
||
| void requestTimeoutExample |
There was a problem hiding this comment.
Issue: The void requestTimeoutExample pattern (function reference without invocation) is inconsistent with other examples in this file that either use void functionName() (not present) or don't have any trailing invocation. Looking at the rest of the file, other examples like guardrailsExample don't have a void reference at the end.
Suggestion: Remove this line to match the pattern used by the other example functions in this file, or add it to all of them for consistency.
|
Assessment: Comment This is a well-structured batch documentation update that follows repository patterns consistently. The snippet file organization, import patterns, and Tab structure are all correct. Review Categories
Solid contribution — thorough coverage of the TS SDK changes with well-organized examples. |
Description
Batch documentation update covering recent TypeScript SDK changes. Each section points to the upstream PR; all TS API verified against
the merge commits, snippet typecheck passes.
BeforeNodeCallEvent in Swarm/Graph, InterruptEvent row + lifecycle node on the hooks page.
selectedTool, mutable toolUse/result, resume; replaced six "not yet available" placeholders (Tool Interception, Result Modification,
three resume scenarios).
Backoff Strategies subsection, DefaultModelRetryStrategy.isRetryable example.
Bedrock 120s default requestTimeout override.
new per-content-type behavior.
INVALID_TOOL_NAME substitution.
Related Issues
Type of Change
Checklist
npm run devBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.