OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Add AgentRejectAction across multiple modules

Open li-boxuan opened this issue 1 year ago • 2 comments

This commit introduces the AgentRejectAction class and integrates it across various modules and actions. It includes updates to READMEs, action definitions, and agent controllers to handle the new 'reject' action. This functionality will allow agents to properly signal task rejection.

===========BELOW COMMIT MESSAGE IS GENERATED BY OPENDEVIN=============

Yes, again I am too lazy to write a commit message by myself. So I asked OpenDevin to do me the favour:

WORKSPACE_MOUNT_PATH="`PWD`" SANDBOX_TYPE="exec" poetry run python opendevin/core/main.py -t "write a commit message" -c ManagerAgent -d ./

Why this PR is needed?

  1. To give the user and/or delegator agent a chance to rethink about the task
  2. To encourage agent developers to think about edge/failure cases. E.g. without the prompt change included in this PR, CommitWriterAgent never finishes when running in a non-git folder
  3. To differentiate between success and failure (ofc). Without this PR, we don't know if There is no diff in the staging area; no changes to commit. output from CommitWriterAgent really means there's no change to commit, OR the output itself is literally the compiled commit message.

TODO in this PR:

  • [x] ~~Update backend_architecture.puml~~ This should be a separate issue.

Future work:

  • [ ] Delegator should be able to rethink about the task assignment
  • [ ] Micro-agents should have enforcements for their inputs & outputs schema
  • [ ] UI changes to differentiate between "Finish" and "Reject"
  • [ ] Any other agent needs to use "Reject" action?

li-boxuan avatar May 07 '24 04:05 li-boxuan

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes are missing coverage. Please review.

:exclamation: No coverage uploaded for pull request base (main@242c4a0). Click here to learn what that means.

Files Patch % Lines
opendevin/controller/agent_controller.py 0.00% 1 Missing :warning:
opendevin/events/action/agent.py 87.50% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1615   +/-   ##
=======================================
  Coverage        ?   39.05%           
=======================================
  Files           ?       92           
  Lines           ?     3731           
  Branches        ?        0           
=======================================
  Hits            ?     1457           
  Misses          ?     2274           
  Partials        ?        0           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 07 '24 04:05 codecov-commenter

Very cool! Agree this will be useful

rbren avatar May 07 '24 11:05 rbren