Skip to content

Strands BidiAgent support Nova 2 Sonic expert tool#2873

Closed
lanazhang wants to merge 0 commit into
strands-agents:mainfrom
lanazhang:main
Closed

Strands BidiAgent support Nova 2 Sonic expert tool#2873
lanazhang wants to merge 0 commit into
strands-agents:mainfrom
lanazhang:main

Conversation

@lanazhang

@lanazhang lanazhang commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

Adds Expert Tool support to BidiNovaSonicModel, enabling bring-your-own-LLM reasoning while Nova Sonic handles ASR and TTS.

New module: strands/experimental/bidi/expert_tool/

  • ExpertToolReasoner — protocol for custom reasoning implementations
  • BedrockConverseReasoner — built-in reasoner wrapping any Bedrock Converse model with automatic tool calling loops
  • StrandsAgentReasoner — wraps any Strands Agent as a reasoner (OpenAI, Gemini, Ollama, etc.)
  • ExpertToolConfig — advanced configuration (streaming strategy, interruption callbacks, fallback messages)
  • _ExpertToolManager — internal lifecycle manager handling content containers, streaming, barge-in cancellation, and error recovery

Changes to BidiNovaSonicModel:

  • New reasoner parameter (shorthand) and expert_tool parameter (advanced config)
  • Registers ExpertTool spec in promptStart when reasoner is configured
  • Intercepts ExpertTool toolUse events and routes to manager instead of agent loop
  • Validates Expert Tool is only used with Nova Sonic v2
  • Shuts down manager on stop()

Related Issues

N/A

Documentation PR

NA

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce new warnings.

  • 90 unit tests covering config, reasoner (protocol compliance, message conversion, tool calling loops, streaming, error handling), manager (invocation lifecycle, barge-in cancellation, content flags, event helpers), and nova_sonic integration (init validation, spec injection, event interception, stop cleanup)

  • All 31 existing test_nova_sonic.py tests continue to pass

  • Manual end-to-end testing with Qwen3 32B, Nova 2 Lite, and Claude Sonnet as reasoning LLMs — verified multi-turn conversation, tool calling, and barge-in handling

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have reviewed and understand every line of code in this PR, including any generated by AI tools, and I can explain why it works
  • My change is focused and reasonably small; I have split unrelated work into separate PRs
  • 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.

@github-actions github-actions Bot added size/l python Pull requests that update python code enhancement New feature or request area-bidirectional-streaming Related to bidirectional streaming area-tool Tool behavior/api size/xl and removed size/l size/xl labels Jun 19, 2026
@mehtarac mehtarac self-assigned this Jul 2, 2026
@chaynabors
chaynabors requested review from a team and opieter-aws and removed request for a team July 9, 2026 15:34
@opieter-aws
opieter-aws requested review from mehtarac and removed request for opieter-aws July 9, 2026 15:38
@lanazhang lanazhang closed this Jul 17, 2026
@github-actions github-actions Bot added size/xs and removed size/l labels Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-bidirectional-streaming Related to bidirectional streaming area-tool Tool behavior/api enhancement New feature or request python Pull requests that update python code size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants