Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

docs: add TypeScript examples for retry strategies#767

Open
nol4lej wants to merge 1 commit into
strands-agents:mainfrom
nol4lej:docs/typescript-retry-examples
Open

docs: add TypeScript examples for retry strategies#767
nol4lej wants to merge 1 commit into
strands-agents:mainfrom
nol4lej:docs/typescript-retry-examples

Conversation

@nol4lej

@nol4lej nol4lej commented Apr 18, 2026

Copy link
Copy Markdown

Description

Add TypeScript code examples to replace // Not supported in TypeScript and
// This feature is not yet available in TypeScript SDK placeholders in
retry-strategies.mdx and hooks.mdx.

Changes:

  • Add retry-strategies.ts with three snippet sections:

    • customizing_retry — exponential backoff using AfterModelCallEvent and ModelThrottledError
    • disabling_retry — explanation that TypeScript has no built-in retry mechanism
    • custom_retry_logic — custom retry logic via event.retry = true
  • Update hooks.ts with three plugin class examples:

    • RetryOnServiceUnavailable — retries on ServiceUnavailableException with exponential backoff
    • PropagateUnexpectedExceptions — re-throws non-allowlisted errors from tool calls
    • RetryOnToolError — retries failed tool calls tracking attempts per toolUseId
  • Update retry-strategies.mdx and hooks.mdx to use snippet inclusions in the existing TypeScript tabs

Type of Change

  • Content update/revision

Checklist

  • I have read the CONTRIBUTING document
  • My changes follow the project's documentation style
  • I have tested the documentation locally using npm run dev
  • Links in the documentation are valid and working

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Replace \"// Not supported in TypeScript\" placeholders in
retry-strategies.mdx and hooks.mdx with working TypeScript
examples using agent.addHook() and AfterModelCallEvent.retry.

@nol4lej nol4lej left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

@strands-agent

Copy link
Copy Markdown
Contributor

This repository has been merged into the strands-agents/harness-sdk monorepo and will be archived shortly. All new development happens there.

If this PR is still relevant, please recreate it against the monorepo. The code now lives under site/. Full commit history was preserved, so your base should be findable.

Apologies for the disruption, and thank you for contributing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants