Skip to content

[WASM] Integration tests: Decorated tools #2374

@awsarron

Description

@awsarron

Parent issue

strands-agents/sdk-typescript#1104

Scope

Write integration tests validating Python-defined tools crossing the WASM boundary:

  • @tool decorator with various type annotations (str, int, list, dict, Optional, etc.)
  • @tool with Google-style docstrings for schema generation
  • Tool class (manual tool definition with name, description, schema, invoke callback)
  • PydanticTool (Pydantic model-based tool definition)
  • Tool invocation via natural language (model decides to call)
  • Direct tool invocation via agent.tool.tool_name(param=value)
  • Multi-tool invocation (model calls multiple tools in one turn)
  • Tool error handling (exceptions in Python tool code)

Context

This tests the host→guest tool-provider import boundary. When the TS SDK agent loop needs to call a tool, it crosses back into Python via the WIT call-tool import. Results flow back as tool-event-stream resources.

Key areas of concern:

  • Type serialization/deserialization across the boundary
  • Error propagation from Python → WASM guest
  • Stream events for tool execution (tool_use, tool_result)

Done when

  • @tool decorator works with common Python types
  • Tool class works for manual definitions
  • PydanticTool works for Pydantic model-based tools
  • Direct method call (agent.tool.name()) works
  • Multi-tool calls in a single turn work
  • Tool errors propagate cleanly without crashing the WASM instance

Metadata

Metadata

Assignees

Labels

area-toolTool behavior/apienhancementNew feature or requestpythonPull requests that update python code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions