π OpenHands: AI-Driven Development
fix Finish action to sent its 'thoughts' in the prompt (#3149)
Engel Nyst3328669b8986
diff --git a/agenthub/codeact_agent/codeact_agent.py b/agenthub/codeact_agent/codeact_agent.pyindex e6eea593c7..319b01e292 100644--- a/agenthub/codeact_agent/codeact_agent.py+++ b/agenthub/codeact_agent/codeact_agent.py@@ -121,6 +121,8 @@ class CodeActAgent(Agent):return f'{action.thought}\n<execute_browse>\n{action.inputs["task"]}\n</execute_browse>'elif isinstance(action, MessageAction):return action.content+ elif isinstance(action, AgentFinishAction) and action.source == 'agent':+ return action.thoughtreturn ''def get_action_message(self, action: Action) -> dict[str, str] | None:@@ -129,6 +131,7 @@ class CodeActAgent(Agent):or isinstance(action, CmdRunAction)or isinstance(action, IPythonRunCellAction)or isinstance(action, MessageAction)+ or (isinstance(action, AgentFinishAction) and action.source == 'agent')):return {'role': 'user' if action.source == 'user' else 'assistant',