Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nit: improve error message when action is not executed #7029

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion openhands/controller/agent_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
TRAFFIC_CONTROL_REMINDER = (
"Please click on resume button if you'd like to continue, or start a new task."
)
ERROR_ACTION_NOT_EXECUTED = 'The action has not been executed. This likely occurred because the runtime system crashed due to resource limitations. Note that the OpenHands agent has limited resources available for running commands. The agent can retry this action - the runtime system can be rebooted when retrying. However, be aware that any dependencies, environment variables, or other system state previously set up by the agent might be lost after the reboot process.'
Copy link
Collaborator

@rbren rbren Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ERROR_ACTION_NOT_EXECUTED = 'The action has not been executed. This likely occurred because the runtime system crashed due to resource limitations. Note that the OpenHands agent has limited resources available for running commands. The agent can retry this action - the runtime system can be rebooted when retrying. However, be aware that any dependencies, environment variables, or other system state previously set up by the agent might be lost after the reboot process.'
ERROR_ACTION_NOT_EXECUTED = 'The action has not been executed. This likely occurred because the runtime system crashed and was rebooted due to resource limitations. Be aware that any dependencies, environment variables, or other system state previously set up by the agent may have been lost after the reboot process.'

Reboot happens on crash, not on next action.

Keeping this reasonably short is probably a good idea too


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this happens also when the user pressed STOP button. I'm checking now if I'm not hallucinating 😅

I'm thinking also... this is a bit interesting message because it feels made for remote, but I don't know how suitable it is for local use. 🤔

If running literally on local runtime, probably not quite right?

Copy link
Collaborator

@enyst enyst Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm it happens also when the user presses the 'Stop' button 🤔 which makes sense, that action will never complete (or so we assume or hope!), so we give the agent LLM something with tool_id.


class AgentController:
Expand Down Expand Up @@ -450,7 +451,7 @@ def _reset(self) -> None:

# make a new ErrorObservation with the tool call metadata
if not found_observation:
obs = ErrorObservation(content='The action has not been executed.')
obs = ErrorObservation(content=ERROR_ACTION_NOT_EXECUTED)
obs.tool_call_metadata = self._pending_action.tool_call_metadata
obs._cause = self._pending_action.id # type: ignore[attr-defined]
self.event_stream.add_event(obs, EventSource.AGENT)
Expand Down
Loading