Skip to content

feat(engine): add RemoteAgentFlowEngine for remote agent runtimes#441

Open
luyuzhe111 wants to merge 7 commits intorllm-org:mainfrom
luyuzhe111:agentcore_integ
Open

feat(engine): add RemoteAgentFlowEngine for remote agent runtimes#441
luyuzhe111 wants to merge 7 commits intorllm-org:mainfrom
luyuzhe111:agentcore_integ

Conversation

@luyuzhe111
Copy link
Contributor

@luyuzhe111 luyuzhe111 commented Mar 13, 2026

Summary

This PR adds the integration of AWS Bedrock AgentCore Runtime as a sandboxed remote agent runtime backend where agents and environments collocate. AgentCore Runtime handles isolation and auto-scaling to allow secure and parallel rollouts.

Type of change

  • Feature
  • Fix
  • Docs
  • Refactor
  • Example / Project
  • Infra / CI

What changed

  • Introduce RemoteAgentFlowEngine and RemoteAgentRuntime protocol for "agent-in-sandbox" runtimes where agent and environment colocate in a remote container.
  • Include AgentCore Runtime adapter using ART's RolloutClient, auto-detection of routable gateway IP for cross-host access, and shared compute_step_metrics utility.
  • Gateway now binds to 0.0.0.0 while advertising the routable IP to remote agents to allow access
  • Add per-session sampling parameters support in gateway server (different sampling params for train vs val). GatewayManager registers the parameters and selects the right one based on the is_validation flag.
  • In pyproject.toml: add agentcore as an extra dependency, add rllm-model-gateway as a uv source to install in editable mode, and enable ruff line check (default is 88 chars, which results in numerous cosmetic wraps; changed to 120 to align with modern convention).

Validation

  • pre-commit run --all-files
  • Targeted tests: pytest ...
  • Manual validation performed
  • Not run (reason below)

It seems there are a bunch of pre-commit errors from existing code. might need a separate PR to clean them up.

Validation details:

  • uv run pytest tests/engine/test_remote_runtime.py -v passed.
  • uv run pytest tests/integration/ -v -s passed locally with AGENTCORE_AGENT_ARN, AGENTCORE_S3_BUCKET, AGENTCORE_BASE_URL, and AGENTCORE_MODEL_ID set.
  • e2e training with bash examples/agentcore_math/train_agentcore_math_tinker.sh. The reward curves from rllm-ui are attached below:

Train:
Screenshot 2026-03-24 at 11 11 56 AM

Val:
Screenshot 2026-03-24 at 11 12 38 AM

Docs / examples

  • Not needed
  • Updated docs
  • Updated examples
  • Follow-up docs needed

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.

1 participant