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

refactor the logic in agent_controller to imporve readability #3873

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

WannaTen
Copy link
Contributor

Short description of the problem this fixes or functionality that this introduces. This may be used for the CHANGELOG

mainly on refactor the logic in agent_controller to imporve readability.


Give a summary of what the PR does, explaining any non-trivial design decisions

  • on_event: Refactored event processing by splitting it into two distinct functions: _handle_action and _handle_observation
  • set_agent_state_to: Consolidated new_state checks into a single if..elif structure, replacing multiple parallel if statements
  • _step: Isolated delegate step functionality and integrated traffic limit handling logic

Link of any specific issues this addresses

Signed-off-by: Yi Lin <teroincn@gmail.com>
@WannaTen
Copy link
Contributor Author

I'm still working on this. modifying testcases to validate the entire set of modifications. Besides, maybe the "confirmed by human" step can be improved futher,

Signed-off-by: Yi Lin <teroincn@gmail.com>
Signed-off-by: Yi Lin <teroincn@gmail.com>
@WannaTen WannaTen marked this pull request as ready for review September 16, 2024 15:57
Copy link
Contributor

@neubig neubig left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this! This already looks like a significant improvement over what we had before. Really appreciated.

@neubig neubig merged commit 804674b into All-Hands-AI:main Sep 16, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants