mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
(fix) CodeActAgent: use content of AgentDelegateObservation (#3970)
Co-authored-by: Ryan H. Tran <descience.thh10@gmail.com>
This commit is contained in:
@@ -153,7 +153,10 @@ class CodeActAgent(Agent):
|
||||
text = truncate_content(text, max_message_chars)
|
||||
return Message(role='user', content=[TextContent(text=text)])
|
||||
elif isinstance(obs, AgentDelegateObservation):
|
||||
text = obs_prefix + truncate_content(str(obs.outputs), max_message_chars)
|
||||
text = obs_prefix + truncate_content(
|
||||
obs.outputs['content'] if 'content' in obs.outputs else '',
|
||||
max_message_chars,
|
||||
)
|
||||
return Message(role='user', content=[TextContent(text=text)])
|
||||
elif isinstance(obs, ErrorObservation):
|
||||
text = obs_prefix + truncate_content(obs.content, max_message_chars)
|
||||
|
||||
@@ -402,7 +402,13 @@ The server is running on port 5000 with PID 126. You can access the list of numb
|
||||
|
||||
|
||||
NOW, LET'S START!
|
||||
|
||||
----------
|
||||
|
||||
Browse localhost:8000, and tell me the ultimate answer to life. Do not ask me for confirmation at any point.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
|
||||
ENVIRONMENT REMINDER: You have 19 turns left to complete the task. When finished reply with <finish></finish>.
|
||||
|
||||
@@ -402,6 +402,9 @@ The server is running on port 5000 with PID 126. You can access the list of numb
|
||||
|
||||
|
||||
NOW, LET'S START!
|
||||
|
||||
----------
|
||||
|
||||
Browse localhost:8000, and tell me the ultimate answer to life. Do not ask me for confirmation at any point.
|
||||
|
||||
----------
|
||||
@@ -414,7 +417,10 @@ Browse localhost:8000, and tell me the ultimate answer to life. Do not ask me fo
|
||||
----------
|
||||
|
||||
OBSERVATION:
|
||||
{'content': 'The answer to life, the universe, and everything has been revealed: OpenHands is all you need!'}
|
||||
The answer to life, the universe, and everything has been revealed: OpenHands is all you need!
|
||||
|
||||
----------
|
||||
|
||||
|
||||
|
||||
ENVIRONMENT REMINDER: You have 13 turns left to complete the task. When finished reply with <finish></finish>.
|
||||
|
||||
Reference in New Issue
Block a user