All-Hands-AI / OpenHands

🙌 OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
36.16k stars 4.12k forks source link

[Bug]: Disable function calling for DeepSeek #4604

Closed enyst closed 1 week ago

enyst commented 2 weeks ago

Is there an existing issue for the same bug?

Describe the bug and reproduction steps

Trying to run on the current main with UI. I started a new "project" in the UI. Then I wrote "print 55":

10:13:33 - openhands:DEBUG: stream.py:144 - Adding ErrorObservation id=10 from USER
10:13:33 - openhands:DEBUG: stream.py:144 - Adding AgentStateChangedObservation id=11 from AGENT
10:13:33 - openhands:DEBUG: agent_controller.py:135
OBSERVATION
[Agent Controller dfcf323b-009e-4e0d-af91-126f1fe9ca4f] **ErrorObservation**
There was an unexpected error while running the agent:litellm.BadRequestError: DeepseekException - Failed to deserialize the JSON body into the target type: messages[2]: invalid type: sequence, expected a string at line 1 column 683

DeepSeek supports tool use, but I'm not sure we tested with DeepSeek? We really need that CI eval PR. 😅

Note:


print 55


- the second prompt was:

You are a helpful assistant that can interact with a computer to solve tasks.

* If user provides a path, you should NOT assume it's relative to the current working directory. Instead, you should explore the file system to find the file before working on it.

print 55



OBSERVATION: echo 55 55[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.12/bin/python] openhands@openhands-workspace:/workspace $ [Command finished with exit code 0]



### OpenHands Installation

Development workflow

### OpenHands Version

_No response_

### Operating System

None

### Logs, Errors, Screenshots, and Additional Context

_No response_
enyst commented 2 weeks ago

We need to disable function calling for DeepSeek.

Function calling is enabled or disabled in the openhands/agenthub/codeact_agent/codeact_agent.py file.

We can define some module global to disable it for any models with 'deepseek'.

github-actions[bot] commented 2 weeks ago

OpenHands started fixing the issue! You can monitor the progress here.

github-actions[bot] commented 2 weeks ago

An attempt was made to automatically fix this issue, but it was unsuccessful. A branch named 'openhands-fix-issue-4604' has been created with the attempted changes. You can view the branch here. Manual intervention may be required.

enyst commented 1 week ago

Fixed by https://github.com/All-Hands-AI/OpenHands/pull/4617