Critical Issue: KeyError when Agent passes parameters to ProfileManager tool - unable to save user profiles
Description
Summary
The Investment Advisor agent is unable to save user profiles due to a parameter format mismatch between how the
agent passes parameters to the ProfileManager tool and how the tool expects to receive them. This results in
persistent KeyError exceptions during tool invocation.
Environment
- Neuro-San Studio
- Investment Advisor application
- ProfileManager tool in coded_tools/investment_advisor/profile_manager.py
Observed Behavior
When the agent attempts to save a user profile:
- The agent receives the information from the user
- The agent acknowledges the information and attempts to save it
- Multiple "retrying from KeyError" warnings appear in server logs
- The profile data is not saved to the file system
- The agent reports to the user that there was a technical issue saving the profile
Expected Behavior
When the agent receives profile information from the user, it should:
- Successfully pass the parameters to the ProfileManager tool
- The profile should be saved to the file system
- The agent should confirm successful saving to the user
Server Logs
NeuroSan: {"message": "retrying from KeyError", "user_id": "", "Timestamp": "2025-06-12T18:16:04.155484",
"source": "Agent Server", "message_type": "Warning", "request_id": "server-5d452c5a-d4f4-40cb-91f1-682da7357510"}
NeuroSan: {"message": "retrying from KeyError", "user_id": "", "Timestamp": "2025-06-12T18:16:04.156346",
"source": "Agent Server", "message_type": "Warning", "request_id": "server-5d452c5a-d4f4-40cb-91f1-682da7357510"}
NeuroSan: {"message": "retrying from KeyError", "user_id": "", "Timestamp": "2025-06-12T18:16:04.156346",
"source": "Agent Server", "message_type": "Warning", "request_id": "server-5d452c5a-d4f4-40cb-91f1-682da7357510"}
Attempted Solutions
- Enhanced Error Handling: Implemented robust parameter extraction and error handling in ProfileManager
- Parameter Format Adaptation: Added code to handle various parameter formats (nested dictionaries, direct
parameters)
- Detailed Logging: Created logging tools to try to capture the exact parameter format
- HOCON Updates: Modified agent instructions with explicit parameter formats
- Workarounds: Created fallback methods that don't require proper parameters
Despite all these approaches, the KeyError persists, suggesting a deeper framework-level mismatch in how
parameters are passed.
Impact
This issue prevents the Investment Advisor from functioning correctly. Users cannot save their investment
preferences, which blocks the core functionality of providing personalized portfolio recommendations.
Proposed Solution
The framework needs to ensure consistent parameter passing between agents and tools. Either:
- Standardize how agents structure parameters when calling tools
- Provide tools with the raw parameter data in a predictable format
- Add a parameter normalization layer between agents and tools
The current mismatch between how agents format parameters and how tools expect them makes reliable tool usage
impossible.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗