Fix TypeError in tool calls and KeyError in orchestrator agent creation#81
Open
he-yufeng wants to merge 1 commit intoHKUDS:mainfrom
Open
Fix TypeError in tool calls and KeyError in orchestrator agent creation#81he-yufeng wants to merge 1 commit intoHKUDS:mainfrom
he-yufeng wants to merge 1 commit intoHKUDS:mainfrom
Conversation
…r_agent core.py: json.loads(arguments) can return a non-dict when the LLM emits a bare JSON value instead of an object. Map it to the first parameter so the call doesn't crash. edit_agents.py: create_orchestrator_agent did a blind dict lookup for each sub-agent name. Return a clear error if any name isn't in the registry yet, instead of raising a KeyError. Fixes HKUDS#73, HKUDS#71
Author
|
Ping — is there anything I should change here? Been a few weeks. |
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.
Fixes #73 and #71.
Issue #73 —
TypeError: 'str' object does not support item assignmentjson.loads(tool_call.function.arguments)can return a string when the LLM outputs a bare JSON value instead of a JSON object. The fix checks the type after parsing and maps the value to the first non-context parameter.Issue #71 —
KeyError: 'Market Analysis Agent'create_orchestrator_agentblindly looked up sub-agent names inagent_dictwithout checking they exist first. The fix returns a descriptive error message listing which sub-agents are missing from the registry.