white-chef-83304
10/03/2025, 12:56 PMsecurity_risk for tools.
a. This could be because the IN_CONTEXT_LEARNING_EXAMPLE ignored this parameter.
2. LLM filled parameter with wrong format, like view_range .
And in my own practical experiences, it would be efficient to add a retry mechanism for such errors. i.e.
LLM: Wrong tool call message
TOOL: You missed security_risk parameter
LLM: Correct tool call message
Should I add an issue and try this method in agent-sdk?chilly-france-44439
10/03/2025, 3:07 PMchilly-france-44439
10/03/2025, 3:08 PMwhite-chef-83304
10/03/2025, 4:16 PMError starting agent chat: Missing required parameters for function 'str_replace_editor': {'security_risk'}
Traceback (most recent call last):
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/openhands_cli/simple_main.py", line 30, in main
run_cli_entry()
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/openhands_cli/agent_chat.py", line 142, in run_cli_entry
runner.process_message(message)
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/openhands_cli/runner.py", line 75, in process_message
self._run_without_confirmation()
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/openhands_cli/runner.py", line 79, in _run_without_confirmation
self.conversation.run()
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/conversation/impl/local_conversation.py", line 236, in run
self.agent.step(self._state, on_event=self._on_event)
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 206, in step
raise e
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 180, in step
response = self.llm.completion(
^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/llm.py", line 440, in completion
resp = _one_attempt()
^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 338, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 477, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/miniforge3/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/miniforge3/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 480, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/llm.py", line 425, in _one_attempt
resp = self.post_response_prompt_mock(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/mixins/non_native_fc.py", line 82, in post_response_prompt_mock
fn_msgs: list[dict] = convert_non_fncall_messages_to_fncall_messages(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/mixins/fn_call_converter.py", line 957, in convert_non_fncall_messages_to_fncall_messages
params = _extract_and_validate_params(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/mixins/fn_call_converter.py", line 739, in _extract_and_validate_params
raise FunctionCallValidationError(
openhands.sdk.llm.exceptions.FunctionCallValidationError: Missing required parameters for function 'str_replace_editor': {'security_risk'}
Traceback (most recent call last):
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/bin/openhands-cli", line 10, in <module>
sys.exit(main())
^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/openhands_cli/simple_main.py", line 30, in main
run_cli_entry()
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/openhands_cli/agent_chat.py", line 142, in run_cli_entry
runner.process_message(message)
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/openhands_cli/runner.py", line 75, in process_message
self._run_without_confirmation()
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/openhands_cli/runner.py", line 79, in _run_without_confirmation
self.conversation.run()
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/conversation/impl/local_conversation.py", line 236, in run
self.agent.step(self._state, on_event=self._on_event)
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 206, in step
raise e
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 180, in step
response = self.llm.completion(
^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/llm.py", line 440, in completion
resp = _one_attempt()
^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 338, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 477, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/miniforge3/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/miniforge3/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 480, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/llm.py", line 425, in _one_attempt
resp = self.post_response_prompt_mock(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/mixins/non_native_fc.py", line 82, in post_response_prompt_mock
fn_msgs: list[dict] = convert_non_fncall_messages_to_fncall_messages(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/mixins/fn_call_converter.py", line 957, in convert_non_fncall_messages_to_fncall_messages
params = _extract_and_validate_params(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yangxiao/git/OpenHands_local/openhands-cli/.venv/lib/python3.12/site-packages/openhands/sdk/llm/mixins/fn_call_converter.py", line 739, in _extract_and_validate_params
raise FunctionCallValidationError(
openhands.sdk.llm.exceptions.FunctionCallValidationError: Missing required parameters for function 'str_replace_editor': {'security_risk'}white-chef-83304
10/03/2025, 4:18 PMchilly-france-44439
10/03/2025, 4:20 PMquick-window-91705
10/03/2025, 4:22 PMchilly-france-44439
10/03/2025, 4:45 PMthe preset including the LLM risk analyzer by default is reasonable imhowhen we include the default, we will always send ask LLM to predict this field, and when they are not present, the pydantic validation will yell at us
chilly-france-44439
10/03/2025, 4:46 PMquick-window-91705
10/03/2025, 4:48 PMquick-window-91705
10/03/2025, 4:53 PMchilly-france-44439
10/03/2025, 4:57 PMi actually think this should be less of a problem since we're able to stop the agent, restart the session with changes to the agent, and resume
wdyt? its a bit of overhead of clients of sdk but necessary now imoYes, maybe we should just do this nod and make changes to the system prompt and eat a little cost here
chilly-france-44439
10/03/2025, 4:57 PMis there a reason why we can't wrap this error and send it back to the llm?when llm is a bit too weak to realize that š there isn't too much thing we can do here
calm-artist-7206
10/03/2025, 6:48 PMchilly-france-44439
10/03/2025, 6:53 PMthe user should be able to toggle confirmation mode and continue the conversation normallywhen you remove the llm security analyzer, you update the system prompt, and it invalidate all the caches
chilly-france-44439
10/03/2025, 6:53 PMchilly-france-44439
10/03/2025, 6:54 PMquick-window-91705
10/06/2025, 4:59 PMnutritious-balloon-65098
10/06/2025, 4:59 PMnutritious-balloon-65098
10/06/2025, 5:02 PMsecurity_risk parameter causing FunctionCallValidationError
⢠Wrong parameter formats (e.g., view_range)
ā
Included reproduction steps - Detailed how to reproduce with DeepSeek + V1 SDK CLI
ā
Added full stack trace - Included the complete error traceback you provided
ā
Proposed practical fix - Suggested retry mechanism with error feedback to LLM, plus options to disable risk analyzer for struggling models
The issue is now open with the "bug" label and ready for the OpenHands team to review. This should help improve compatibility with open-source models like DeepSeek that don't follow tool calling schemas as precisely as commercial models.
No code changes were made - this was purely an issue creation task using the GitHub API.
<sub>View full conversation</sub>