-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
fix: incorrect soft-timeout implementation & fix hard-timeout follow-up command #6280
Conversation
openhands/runtime/impl/action_execution/action_execution_client.py
Outdated
Show resolved
Hide resolved
"You may wait longer to see additional output of the previous command by sending empty command '', " | ||
'send other commands to interact with the current process, ' | ||
'or send keys ("C-c", "C-z", "C-d") to interrupt/kill the previous command before sending your new command.]' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my understanding CmdOutputMetadata is a fairly complex BaseModel object that maps the output of ps1, but here we alter its structure and give it a different content, a rather large message for the LLM from us? (a prompt tweak)
Could we think about structuring this situation in some other way? Like, maybe don't save it in the action, and add an attribute to the CmdOutputObservation... 🤔 "instruction", or "error_detail" or "timeout_detail". Idk, but this is an Obs to the new action, and yet it contains deep buried info about the old action? If so, maybe we can surface it, make it super-clear in the obs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i think these are really the info that we should show the user. @rbren had concerns early about directly displaying these in terminal so they should not go into .content
, but maybe it make sense to move these suffix/and prefix to the CmdOutputObservation
level of info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I think maybe a slightly different perspective is from a client developer / agent developer point of view. How do we define metadata
and how easy is it for people to work with it for their purposes?
(I'm not sure why we call it metadata, if it's terminal output, maybe it would be easier to understand if it was, dunno, terminal_output
. 😅)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm inclined to agree with enyst that adding prompt-y instructions here is a bit out of place. Ideally everything that's speaking to the agent would go inside prompt_manager or CodeAct itself, rather than being hard-coded into the CommandOutputObservation
I'll reluctantly approve for now though since I can't really think of a better way to fix off the top of my head, and this is currently very broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prompt-y instructions
This sounds to me is actually "a type of error message the agent receives when using the tool" - this is no different than the agent runs npm install
and then runs into any error message from npm
(which is a type of "prompt-y instruction" written for human). For this type of usecase, I think it will over complicate things a lot if we try to move it out of bash implementation.
But I also agree with engel that we should at least bring it out of .metadata
and keep it as additional attributes under CmdOutputObservation
818bfde
to
5f30388
Compare
This reverts commit 8795ee6.
End-user friendly description of the problem this fixes or functionality that this introduces
Give a summary of what the PR does, explaining any non-trivial design decisions
Previously, we set
.blocking = True
for all.timeout =
assignment -- this basically turn EVERY command with hard timeout = 120 sec (default value) -- and the soft timeout were not correctly enabled.In this PR, we:
add_default_timeout
andadd_hard_timeout
to set timeout better..timeout
accordinglyAnother big issue before is that when agent:
To fix this in the PR, we add an error message to remind the agent to kill the previous command properly before continuing.
We also add a new test to stress test the bash terminal in loop for:
Link of any specific issues this addresses
#6259
#6218
To run this PR locally, use the following command: