Skip to content

test(examples): Add OpenClaw online RL integration test#977

Merged
garrett4wade merged 1 commit intomainfrom
sxj/add_openclaw_test
Mar 4, 2026
Merged

test(examples): Add OpenClaw online RL integration test#977
garrett4wade merged 1 commit intomainfrom
sxj/add_openclaw_test

Conversation

@fishcrap
Copy link
Copy Markdown
Collaborator

@fishcrap fishcrap commented Mar 4, 2026

Description

Add integration test for OpenClaw online RL training that validates the complete demo lifecycle via HTTP requests.

The test (test_openclaw_online_rl):

  • Starts the online RL service with SGLang rollout + FSDP training
  • Runs episodes via HTTP (start_session → chat/completions → set_reward)
  • Verifies a training step completes successfully
  • Requires 2 GPUs (1 for SGLang rollout, 1 for FSDP training)

Related Issue

N/A - Improves test coverage for OpenClaw example

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not
    work as expected)
  • Documentation update
  • Code refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Checklist

  • I have read the Contributing Guide
  • I have run formatting tools (pre-commit or manual)
  • I have run relevant unit tests and they pass
  • I have added tests for new functionality
  • I have updated documentation if needed
  • My branch is up to date with main
  • This PR introduces breaking changes (if yes, fill out details below)
  • If this PR changes documentation, I have built and previewed it locally with
    jb build docs
  • No critical issues raised by AI reviewers (/gemini review)

Breaking Change Details (if applicable):

N/A

Additional Context

N/A

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 significantly enhances the test coverage for the OpenClaw example by introducing a comprehensive integration test. This new test ensures the end-to-end functionality of the online Reinforcement Learning training pipeline, from service initialization to reward assignment and training step completion, by simulating real-world HTTP interactions. This improves the reliability and stability of the OpenClaw online RL system.

Highlights

  • New Integration Test: Added a new integration test for the OpenClaw online RL training process, validating the complete demo lifecycle via HTTP requests.
  • Online RL Service Validation: The test starts the online RL service with SGLang rollout and FSDP training, runs multiple episodes through HTTP requests (start_session, chat/completions, set_reward), and verifies that a training step successfully completes.
  • GPU Requirement: The test is marked to require at least 2 GPUs, with one used for SGLang rollout and the other for FSDP training.

🧠 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.

Changelog
  • tests/test_examples.py
    • Added a new integration test test_openclaw_online_rl to validate the OpenClaw online RL training workflow.
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
Copy Markdown
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 adds a valuable integration test for the OpenClaw online RL training workflow. The test covers the full lifecycle from service startup to training step completion via HTTP requests, which is great for ensuring the example works end-to-end.

My review includes a few suggestions to improve the maintainability and readability of the new test code, such as moving an import, extracting hardcoded timeout values into constants, and refactoring duplicated logic into a helper function. These changes will make the test cleaner and easier to understand.

Comment thread tests/test_examples.py Outdated
Comment thread tests/test_examples.py Outdated
Comment thread tests/test_examples.py

time.sleep(5) # settle time

import requests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The requests import is located inside the test function. According to PEP 8 style guidelines, imports should be placed at the top of the file. This improves code readability and avoids potential repeated import overhead. Please move import requests to the file-level imports at the top of tests/test_examples.py.

References
  1. PEP 8: Imports should usually be on separate lines. Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants. (link)

@fishcrap fishcrap force-pushed the sxj/add_openclaw_test branch from 42bd2bc to be05383 Compare March 4, 2026 10:06
@fishcrap fishcrap force-pushed the sxj/add_openclaw_test branch from be05383 to 82bef3d Compare March 4, 2026 10:11
Copy link
Copy Markdown
Collaborator

@rchardx rchardx left a comment

Choose a reason for hiding this comment

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

LGTM. Waiting for CI.

@rchardx rchardx added the safe-to-test Ready to run unit-tests in a PR. label Mar 4, 2026
@rchardx rchardx temporarily deployed to AReaL-unittests March 4, 2026 10:43 — with GitHub Actions Inactive
@garrett4wade garrett4wade merged commit b284fc7 into main Mar 4, 2026
4 checks passed
@garrett4wade garrett4wade deleted the sxj/add_openclaw_test branch March 4, 2026 11:59
leandermaben pushed a commit to leandermaben/AReaL that referenced this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe-to-test Ready to run unit-tests in a PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants