Skip to content

fix(strands-py-wasm): access structured-output via kebab-case attr in invoke_async#2364

Closed
pgrayy wants to merge 1 commit into
strands-agents:mainfrom
pgrayy:pgrayy/fix-invoke-async
Closed

fix(strands-py-wasm): access structured-output via kebab-case attr in invoke_async#2364
pgrayy wants to merge 1 commit into
strands-agents:mainfrom
pgrayy:pgrayy/fix-invoke-async

Conversation

@pgrayy

@pgrayy pgrayy commented May 28, 2026

Copy link
Copy Markdown
Member

Description

The _AgentResultAccumulator.finalize() method accessed stop.structured_output using Python dot notation, but the StopEvent from the WASM runtime is a raw wasmtime Record that stores the field under its WIT kebab-case name structured-output. This caused an AttributeError on every invoke_async call.

Uses getattr(stop, "structured-output") to access the kebab-case attribute correctly.

Also adds an invoke_async integration test.

Related Issues

Tracking: strands-agents/sdk-typescript#1102

Type of Change

Bug fix

Testing

  • Added test_invoke_async_hello_world integration test that exercises invoke_async end-to-end
  • Manually verified concurrent invoke_async calls via asyncio.gather achieve ~1.7x speedup over sequential execution

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

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

@pgrayy pgrayy temporarily deployed to auto-approve May 28, 2026 20:13 — with GitHub Actions Inactive
@pgrayy pgrayy requested a deployment to manual-approval May 28, 2026 20:13 — with GitHub Actions Waiting
@pgrayy pgrayy closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant