Skip to content

Conversation

@hiyuchang
Copy link
Collaborator

Description

As the title says.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hiyuchang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant refactoring to align experience processing with asynchronous programming patterns. The core change involves converting the process_messages_to_experience function into an asynchronous operation, renaming it to process_messages_to_experience_async, and updating all its usages across different workflow implementations. This ensures that the experience generation process can leverage Python's asyncio capabilities, improving concurrency and potentially performance in environments that utilize asynchronous models.

Highlights

  • Asynchronous Function Renaming: The function process_messages_to_experience has been renamed to process_messages_to_experience_async to reflect its new asynchronous nature.
  • Asynchronous Implementation: The process_messages_to_experience_async function, along with its internal call to model.convert_messages_to_experience_async, has been updated to be an async function, requiring await when called.
  • Workflow Class Integration: A new async method, process_messages_to_experience_async, has been added to the base Workflow class, encapsulating the logic for converting messages to experience asynchronously.
  • Call Site Updates: All instances where the original process_messages_to_experience was called across various workflow environments (Alfworld, Frozen Lake, Sciworld, Webshop) have been updated to call the new process_messages_to_experience_async with the await keyword.
  • Type Casting for Rewards: In some workflow environments (Frozen Lake, Webshop), the reward parameter passed to process_messages_to_experience_async is now explicitly cast to a float to ensure type consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an asynchronous version of the process_messages_to_experience method, named process_messages_to_experience_async, and updates several workflow files to use this new async method, including RAFT_alfworld_workflow.py, RAFT_reflect_alfworld_workflow.py, RAFT_utils.py, alfworld_workflow.py, frozen_lake/workflow.py, sciworld_workflow.py, webshop_workflow.py, and workflow_test.py. The reviewer commented that the new process_messages_to_experience_async method duplicates most of the logic from its synchronous counterpart and suggested refactoring the common logic into a private helper method to improve maintainability and reduce code duplication.

@hiyuchang
Copy link
Collaborator Author

/unittest-module-explorer

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
48 47 0 1 0 0 12m 35s

Skipped

Tests Status
tests/explorer/workflow_test.py::TestAgentScopeWorkflowAdapter::test_adapter_v1 skipped ⏭️

Tests

Test Name Status Flaky Duration
tests/explorer/explorer_test.py::TestExplorerCountdownEval::test_explorer 1m 35s
tests/explorer/explorer_test.py::TestExplorerGSM8KRULERNoEval::test_explorer 1m 21s
tests/explorer/explorer_test.py::TestExplorerGSM8k::test_explorer 3m 31s
tests/explorer/explorer_test.py::ServeTest::test_serve 1m 26s
tests/explorer/proxy_test.py::RecorderTest::test_recorder 64ms
tests/explorer/scheduler_test.py::SchedulerTest::test_async_workflow 4.1s
tests/explorer/scheduler_test.py::SchedulerTest::test_concurrent_operations 4.1s
tests/explorer/scheduler_test.py::SchedulerTest::test_dynamic_timeout 12.1s
tests/explorer/scheduler_test.py::SchedulerTest::test_get_results 20.0s
tests/explorer/scheduler_test.py::SchedulerTest::test_metric_calculation_with_non_repeatable_workflow_0 4.1s
tests/explorer/scheduler_test.py::SchedulerTest::test_metric_calculation_with_non_repeatable_workflow_1 4.0s
tests/explorer/scheduler_test.py::SchedulerTest::test_metric_calculation_with_repeatable_workflow_0 4.0s
tests/explorer/scheduler_test.py::SchedulerTest::test_metric_calculation_with_repeatable_workflow_1 4.0s
tests/explorer/scheduler_test.py::SchedulerTest::test_multi_step_execution 4.3s
tests/explorer/scheduler_test.py::SchedulerTest::test_non_repeatable_workflow 4.2s
tests/explorer/scheduler_test.py::SchedulerTest::test_over_rollout_min_wait 8.1s
tests/explorer/scheduler_test.py::SchedulerTest::test_scheduler_all_methods 14.0s
tests/explorer/scheduler_test.py::SchedulerTest::test_scheduler_restart_after_stop 7.5s
tests/explorer/scheduler_test.py::SchedulerTest::test_split_tasks 7.3s
tests/explorer/scheduler_test.py::SchedulerTest::test_stepwise_experience_eid 24.3s
tests/explorer/scheduler_test.py::SchedulerTest::test_wait_all 7.1s
tests/explorer/scheduler_test.py::SchedulerTest::test_wait_all_timeout_with_multi_batch 13.4s
tests/explorer/scheduler_test.py::TestRunnerStateCollection::test_runner_state_collection 9.2s
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_reward_propagation_workflow_0 1ms
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_reward_propagation_workflow_1 602ms
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_step_wise_reward_workflow_0 1ms
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_step_wise_reward_workflow_1 1.0s
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_workflows_raise_error 1ms
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_workflows_stop_at_max_env_steps 1.0s
tests/explorer/workflow_test.py::WorkflowTest::test_gsm8k_workflow 25ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_boxed_workflow 16ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_complex_workflow 129ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_eval_workflow 2ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_fraction_workflow 10ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_workflow 7ms
tests/explorer/workflow_test.py::WorkflowTest::test_rm_gallery_workflow 132ms
tests/explorer/workflow_test.py::WorkflowTest::test_workflow_repeatable_0 1ms
tests/explorer/workflow_test.py::WorkflowTest::test_workflow_repeatable_1 100ms
tests/explorer/workflow_test.py::WorkflowTest::test_workflow_resettable_0 1ms
tests/explorer/workflow_test.py::WorkflowTest::test_workflow_resettable_1 201ms
tests/explorer/workflow_test.py::MultiTurnWorkflowTest_0::test_multi_turn_workflow 21.0s
tests/explorer/workflow_test.py::MultiTurnWorkflowTest_1::test_multi_turn_workflow 56.9s
tests/explorer/workflow_test.py::TestWorkflowStateRecording::test_workflow_state_recording 4.0s
tests/explorer/workflow_test.py::TestAgentScopeWorkflowAdapter::test_adapter_v0 706ms
tests/explorer/workflow_test.py::TestAgentScopeWorkflowAdapter::test_adapter_v1 ⏭️ 1ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner 156ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner_get_state 8.0s
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_with_openai 22.5s

Github Test Reporter by CTRF 💚

@pan-x-c pan-x-c merged commit ded6d23 into modelscope:main Jan 7, 2026
1 check 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.

3 participants