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

[BUG] ToolUse not picked up correctly #533

Description

@kiberonlabsdev

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

0.2.2

Node.js Version

v24.11.1

Operating System

Windows 10

Installation Method

pnpm

Steps to Reproduce

Image

When using AWS bedrock as the provider, when a tool use invocation is stored in a session, the contentBlockFromData does not correctly identify the tool use content block as the key toolUse does not exist, however the type does. We expect it to correctly identify the tool use

Expected Behavior

Tooluse blocks identified correctly, no error thrown

Actual Behavior

Throws an error

    message: 'Unknown ContentBlockData type',
    stack: 'Error: Unknown ContentBlockData type\n' +
      '    at contentBlockFromData (<REDACTED>\\node_modules\\.pnpm\\@strands-agents+sdk@0.2.2_@_4fdc0782c8ba8acb774b26fd67f8f25f\\node_modules\\@strands-agents\\sdk\\src\\types\\messages.ts:618:11)\n' 

Additional Context

No response

Possible Solution

Use the data.type =='toolUse' as an alternate check

Related Issues

No response

Activity

  1. kiberonlabsdev commented on Feb 16, 2026

    @kiberonlabsdev
    Author

    For context this happened because we stored the messages in storage and tried to recreate an agent. There should likely be a serialize messages function instead

  2. zastrowm commented on Feb 17, 2026

    @zastrowm
    Member

    There should likely be a serialize messages function instead

    Yeah; I see this when implementing snapshots as well; this should be fixed when we implement session-management and/or snapshots

  3. self-assigned this
    on Mar 5, 2026
  4. moved this from Design to Implement in TypeScript SDK - V1on Mar 5, 2026
  5. removed their assignment
    on Mar 17, 2026
  6. JackYPCOnline commented on Apr 13, 2026

    @JackYPCOnline
    Contributor

    We shipped snapshot https://github.com/strands-agents/sdk-typescript/blob/main/src/agent/snapshot.ts, it handles message serialization correctly, closing this ticket.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Language

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions