feat: add ROCK + iFlow CLI environment for agentic bash RL training#1
Open
shamanez wants to merge 3 commits intoinitial-agentfrom
Open
feat: add ROCK + iFlow CLI environment for agentic bash RL training#1shamanez wants to merge 3 commits intoinitial-agentfrom
shamanez wants to merge 3 commits intoinitial-agentfrom
Conversation
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
RockBashNativeEnv— an RL environment that connects ROLL's agentic pipeline with iFlow CLI running inside ROCK sandboxes, enabling RL training on autonomous bash/CLI tasks.data/bash_tasks.jsonl) — 20 graded coding tasks (file creation, scripting, pytest, HTTP servers) with automated test-based reward signals.How ROLL connects to iFlow inside ROCK
The core integration lives in
roll/pipeline/agentic/env/rock_bash/env.py(RockBashNativeEnv).The architecture is:
On first
reset(), the environment:rock.sdkModelProxyServiceinside the sandboxEach episode:
_prepare_new_episode()kills the old iFlow process, clears the IPC log, restarts ModelProxyService, and launchesiflow -p "<task prompt>" --yoloHow iFlow talks to the vLLM policy model during training
This is the key RL loop — iFlow CLI does not call an external API. Instead, its LLM requests are intercepted and served by ROLL's own policy model (vLLM), ensuring zero distribution shift between the model being trained and the model generating actions.
The mechanism is file-based IPC via
/data/logs/LLMService.log:The
ModelProxyService(installed viarl_rock[model-service]) handles the file IPC on the sandbox side. iFlow CLI is configured withbaseUrl: "http://127.0.0.1:8080/v1/"andapiKey: "training"— it thinks it's talking to a local OpenAI-compatible API, but the requests are actually intercepted by the file IPC layer and routed to ROLL's vLLM workers.After each episode completes (iFlow writes
SESSION_END), the environment runs the task'stest_commandinside the sandbox and returns a binary reward (1.0 = pass, 0.0 = fail).Files changed
roll/pipeline/agentic/env/rock_bash/env.pyroll/pipeline/agentic/env/rock_bash/__init__.pyroll/pipeline/agentic/env/__init__.pyrock_bash_native_envin GEMexamples/agentic_demo/agent_bash_iflow_prod.yamlexamples/agentic_demo/run_agentic_pipeline_bash_iflow.shexamples/start_agentic_pipeline.pydata/bash_tasks.jsonlagent_how_to_guide/tests/agentic/env_manager/test_traj_env_manager.pyTest plan
curl http://localhost:8080returns{"message":"hello, ROCK!"})python examples/start_agentic_pipeline.py --config_path agentic_demo --config_name agent_bash_iflow_prod🤖 Generated with Claude Code