Open
Conversation
This PR adds a new OpenClaw environment that exposes agentic tool capabilities
for reinforcement learning training. OpenClaw is a personal AI assistant framework
that provides agents with access to:
- File system operations (read, write, edit)
- Shell command execution (exec)
- Web research tools (web_search, web_fetch)
- Memory/context management (memory_search, memory_get)
The environment wraps these capabilities as MCP (Model Context Protocol) tools,
enabling RL agents to learn real-world agentic workflows like coding, research,
and automation tasks.
Features:
- Full MCP tool integration following the OpenEnv patterns
- Isolated workspace per episode for safe exploration
- Sandbox mode for web tools (simulated results)
- Comprehensive test suite
- Docker support with CI integration
Usage:
```python
from openclaw_env import OpenClawEnv
with OpenClawEnv(base_url="http://localhost:8000") as env:
env.reset()
tools = env.list_tools()
result = env.call_tool("exec", command="echo hello")
```
Contributor
Greptile SummaryAdds a new OpenClaw environment following the MCP (Model Context Protocol) pattern established in RFC 003. The implementation provides 8 tools for agentic RL training: file operations (read/write/edit), shell execution (exec), web tools (web_search/web_fetch - simulated in sandbox), and memory management (memory_search/memory_get). Key Changes:
Architecture Alignment:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Agent] -->|ListToolsAction| B[OpenClawEnvironment]
A -->|CallToolAction| B
B --> C{Tool Router}
C -->|exec| D[Shell Execution]
C -->|read/write/edit| E[File Operations]
C -->|web_search/web_fetch| F[Web Tools - Simulated]
C -->|memory_search/memory_get| G[Memory Management]
D --> H[Workspace Sandbox]
E --> H
G --> H
H -->|Observation| A
F -->|Observation| A
I[Infrastructure] -->|reset| B
I -->|state| B
B -->|Creates per episode| H
style H fill:#e1f5ff
style A fill:#fff4e1
style I fill:#ffe1f5
style B fill:#e1ffe1
Last reviewed commit: 984320c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new OpenClaw environment type following the MCP (Model Context Protocol) pattern.
Features
Tools
Testing
cd tests/envs pytest test_openclaw_environment.py -vRelated