Critical Issue: KeyError when Agent passes parameters to ProfileManager tool - unable to save user profiles

Resolved 💬 2 comments Opened Jun 12, 2025 by psk4998 Closed Nov 29, 2025

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:

  1. The agent receives the information from the user
  2. The agent acknowledges the information and attempts to save it
  3. Multiple "retrying from KeyError" warnings appear in server logs
  4. The profile data is not saved to the file system
  5. 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:

  1. Successfully pass the parameters to the ProfileManager tool
  2. The profile should be saved to the file system
  3. 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

  1. Enhanced Error Handling: Implemented robust parameter extraction and error handling in ProfileManager
  2. Parameter Format Adaptation: Added code to handle various parameter formats (nested dictionaries, direct

parameters)

  1. Detailed Logging: Created logging tools to try to capture the exact parameter format
  2. HOCON Updates: Modified agent instructions with explicit parameter formats
  3. 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:

  1. Standardize how agents structure parameters when calling tools
  2. Provide tools with the raw parameter data in a predictable format
  3. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗