[BUG] LLMSteeringHandler not working for model "amazon.nova-lite-v1:0"
Checks
- [x] I have updated to the lastest minor and patch version of Strands
- [x] I have checked the documentation and this is not expected behavior
- [x] I have searched ./issues and there are no duplicates of my issue
SDK Language
Python
Strands Version
1.55.1
Language Runtime Version
3.14.3
Operating System
maOS Tahoe 26.6.2
Installation Method
pip
Steps to Reproduce
Execute an Agent using model amazon.nova-lite-v1:0 and plugin LLMSteeringPlugin
from strands import Agent, tool
from strands.vended_plugins.steering import LLMSteeringHandler
@tool
def send_message() -> str:
"""Send message to Mars."""
return "Message to Mars sent."
agent = Agent(
model="amazon.nova-lite-v1:0",
tools=[send_message],
plugins=[
LLMSteeringHandler(
system_prompt="""You are evaluating a customer service agent's responses."""
)
],
)
result = agent("Send message to Mars using provided tool")
Expected Behavior
The result of calling to the agent should be something like "Great! your message has been sent to Mars"
Actual Behavior
Execution of the agent never ends and prints infinitely the following text:
tool_name=<LLMSteering>, available_tools=<[]> | tool not found in registry
tool_name=<LLMSteering>, available_tools=<[]> | tool not found in registry
tool_name=<LLMSteering>, available_tools=<[]> | tool not found in registry
For every line it is called the LLM model and tool calling is added to the context.
Additional Context
Same error when tool name is prefixed with underscore "_" and using model amazon.nova-lite-v1:0
Example to reproduce:
from strands import Agent, tool
# Add underscore "_" to the name of the tool
@tool
def _send_message() -> str:
"""Send message to Mars."""
return "Message to Mars sent."
agent = Agent(
model="amazon.nova-lite-v1:0",
tools=[_send_message],
)
result = agent("Send message to Mars using provided tool")
Possible Solution
For unknown reasons the model amazon.nova-lite-v1:0 removes the underscore "_" from tool name in the response and that causes that the agent can not find the tool in the registry.
For example if agent registers tool _LLMSteering and the model amazon.nova-lite-v1:0 wants to use this tool, the response from the model does not specify _LLMSteering, it specifies LLMSteering.
To solve the problem with LLMSteeringHandler I propose to rename the structured output _LLMSteering to LLMSteering
Related Issues
No response
I dug into this and can add a root cause. The steering handler's structured-output schema is the underscore-prefixed class _LLMSteering (strands-py/src/strands/vended_plugins/steering/handlers/llm/llm_handler.py), and structured output uses the class name as the forced tool name. Nova echoes the toolUse back with the leading underscore stripped (tool_name=<LLMSteering>), so the registry lookup misses, and there's no cap on the cycle. That's the infinite loop.
Reporter's _send_message repro lines up with this: Bedrock Converse toolSpec names have to start with a letter, so any underscore-prefixed tool name is outside the wire pattern, not just the steering one.
If maintainers open this to contribution and reporter is not already preparing a fix, I'd be happy to take it. Rough shape: rename the steering schema so the derived tool name is Converse-safe, and add a validation warning in the Bedrock provider for tool names outside the pattern, with regression tests for both. The missing retry cap on repeated tool-not-found cycles seems like a separate issue, happy to file that one if maintainers agree. I'll wait for maintainer confirmation.
I will take this issue. Please assign it to me.
The problem seems to be with the tool name registration. The model "amazon.nova-lite-v1:0" might be altering tool names by removing underscores. I will first check the tool registration process in the Agent class, especially how it handles tool names with underscores. A small fix could involve ensuring the tool registry accounts for this name alteration or adjusting the model's response to match the registered tool names. I will verify the fix by reproducing the issue and confirming that the agent completes execution without errors.
In my opinion this specific bug can be solved easily but the underneath problem is that the Agent could be more "hallucination aware", the model amazon.nova-lite-v1:0 removes underscore "_" from tool name but other LLM models could mutate the tool name and the Agent should control without entering in an infinite loop.
Maybe it could be added some control in _executor.py to avoid the infinite loop when the LLM model persists in using the same wrong tool.
@joaquin-formentor - Agreed, that generalizes past nova. Any model that mutates or hallucinates a tool name leaves the loop in the same state, so the unknown-tool path needs to make progress rather than retry forever. That's the missing cap I mentioned above. I'm happy to file it as a separate issue with a standalone repro showing the unbounded model calls (one LLM call per cycle), so the nova-specific name fix here and the general loop guard can be tracked independently. I'll wait for a maintainer's preference before filing.