fix(strands-py-wasm): access structured-output via kebab-case attr in invoke_async#2364
Closed
pgrayy wants to merge 1 commit into
Closed
fix(strands-py-wasm): access structured-output via kebab-case attr in invoke_async#2364pgrayy wants to merge 1 commit into
pgrayy wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
_AgentResultAccumulator.finalize()method accessedstop.structured_outputusing Python dot notation, but theStopEventfrom the WASM runtime is a raw wasmtime Record that stores the field under its WIT kebab-case namestructured-output. This caused anAttributeErroron everyinvoke_asynccall.Uses
getattr(stop, "structured-output")to access the kebab-case attribute correctly.Also adds an
invoke_asyncintegration test.Related Issues
Tracking: strands-agents/sdk-typescript#1102
Type of Change
Bug fix
Testing
test_invoke_async_hello_worldintegration test that exercisesinvoke_asyncend-to-endinvoke_asynccalls viaasyncio.gatherachieve ~1.7x speedup over sequential executionChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.