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

[Bug]: CodeActAgent: o1 replies may contain <execute_ipython> in finish action #4017

Closed
2 tasks done
tobitege opened this issue Sep 24, 2024 · 6 comments
Closed
2 tasks done
Labels
agent quality Related to specific agent quality bug Something isn't working severity:medium Affecting multiple users Stale Inactive for 30 days

Comments

@tobitege
Copy link
Collaborator

Is there an existing issue for the same bug?

Describe the bug

Due to how o1-mini works, and probably o1-preview as well, it may return an AgentFinishAction with embedded code.
Apparently this is currently not supported in the agent as there is no CodeActActionParserIPythonRunCell triggered.

Example with content manually shortened and line breaks added for readability:

I will create the file o1-results.txt and write the findings from Step 1: 
<execute_ipython>create_file('o1-results.txt') append_file('o1-results.txt', """### Findings for Step 1: Understand the cli.py file

The cli.py file serves as the command-line interface for the OpenHands application. It performs the following functions:
[---content shortened---]
Overall, cli.py orchestrates the setup and execution of the agent in a command-line environment,
facilitating interaction between the user and the underlying agent functionalities. """)
</execute_ipython>

In that step's LLM response log we can see at the bottom:

[---content shortened---]
</execute_ipython>

<finish></finish>

In the main logfile we see the AgentFinishAction (I manually added line breaks here for readability):

10:03:18 - openhands:INFO: agent_controller.py:445 - AgentFinishAction(outputs={}, 
thought='I will create the file `o1-results.txt` and write the findings from Step 1:\n
<execute_ipython>\ncreate_file(\'o1-results.txt\')\n
append_file(\'o1-results.txt\', """### Findings for Step 1: Understand the cli.py file\n
\n
The `cli.py` file serves as the command-line interface for the OpenHands application.
It performs the following functions:\n
[---content shortened---]
Overall, `cli.py` orchestrates the setup and execution of the agent in a command-line environment, 
facilitating interaction between the user and the underlying agent functionalities.\n""")\n
</execute_ipython>', action='finish')

Current OpenHands version

0.9.4 as of 2024-09-24

Installation and Configuration

make build
make run

Model and Agent

  • Model: o1-mini
  • Agent: CodeActAgent

Operating System

WSL

Reproduction Steps

See trajectory:
https://www.all-hands.dev/share?share_id=58c3e506b401943c64cc9a2091c7173fe7500c176639ac3fbbdd6659becd1d64

Logs, Errors, Screenshots, and Additional Context

No response

@tobitege tobitege added bug Something isn't working agent quality Related to specific agent quality labels Sep 24, 2024
@enyst
Copy link
Collaborator

enyst commented Sep 24, 2024

Definitely o1-preview as well, had it happen.

I'm not sure this is exactly a bug, more like our continuous adaptation to LLM quirks 😅, but we will have to support it.

@enyst enyst changed the title [Bug]: CodeActAgent: o1-mini replies may contain <execute_ipython> in finish action [Bug]: CodeActAgent: o1 replies may contain <execute_ipython> in finish action Sep 24, 2024
@tobitege
Copy link
Collaborator Author

Well, if it walks like a bug, quacks like a bug... 🤣

@xingyaoww
Copy link
Collaborator

I think it is probably due to o1 doesn't support stop words?

@tobitege
Copy link
Collaborator Author

tobitege commented Sep 24, 2024

Yeh, those get kicked out now by default. I just tell the LLM to not send <finish> ever with code 😬

@mamoodi mamoodi added the severity:medium Affecting multiple users label Oct 2, 2024
Copy link
Contributor

github-actions bot commented Nov 2, 2024

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Inactive for 30 days label Nov 2, 2024
Copy link
Contributor

This issue was closed because it has been stalled for over 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent quality Related to specific agent quality bug Something isn't working severity:medium Affecting multiple users Stale Inactive for 30 days
Projects
None yet
Development

No branches or pull requests

4 participants