Skip to content

feat: added superbrowser tool into runagent cli#129

Merged
RadeenXALNW merged 2 commits into
mainfrom
rad/superbrowser
Jun 20, 2026
Merged

feat: added superbrowser tool into runagent cli#129
RadeenXALNW merged 2 commits into
mainfrom
rad/superbrowser

Conversation

@RadeenXALNW

@RadeenXALNW RadeenXALNW commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added stop and resume CLI commands for managing deployed gateway agents
    • Introduced new serverless SuperBrowser template with deployment documentation and environment configuration
  • Enhancements

    • Deploy command now recognizes superbrowser as a template alias
    • Gateway agents are automatically registered for stop/resume support
  • Deprecations

    • Removed OpenClaw MCP template

RadeenXALNW and others added 2 commits June 20, 2026 09:46
Resolve RunAgentClient.__init__ conflict: keep both api_key/base_url
(superbrowser remote mode) and extra_params + getter methods (main #124/#125).
TS SDK changes from main auto-merged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07c5a373-633e-4e38-a453-c5f8cebc8cb8

📥 Commits

Reviewing files that changed from the base of the PR and between 7c8f2da and 43d266f.

📒 Files selected for processing (16)
  • runagent/cli/commands/deploy.py
  • runagent/cli/commands/resume.py
  • runagent/cli/commands/stop.py
  • runagent/cli/main.py
  • runagent/client/client.py
  • runagent/sdk/rest_client.py
  • templates/openclaw/gateway/runagent.config.json
  • templates/openclaw/mcp/README.md
  • templates/openclaw/mcp/agent.py
  • templates/openclaw/mcp/requirements.txt
  • templates/openclaw/mcp/runagent.config.json
  • templates/superbrowser/default/.env.example
  • templates/superbrowser/default/.gitignore
  • templates/superbrowser/default/README.md
  • templates/superbrowser/default/main.py
  • templates/superbrowser/default/runagent.config.json

📝 Walkthrough

Walkthrough

Adds stop and resume lifecycle commands for stateful gateway agents backed by three new RestClient methods and deploy-time registration. Introduces a new superbrowser/default template with a serverless entrypoint, environment scaffold, and deploy alias. Removes the openclaw/mcp template content and fixes the OpenClaw gateway persistent folder path.

Changes

Gateway Stop/Resume Management

Layer / File(s) Summary
REST API methods and client auth params
runagent/client/client.py, runagent/sdk/rest_client.py
RunAgentClient.__init__ gains optional api_key/base_url params forwarded to RestClient and SocketClient. RestClient gains register_managed_agent, stop_agent, and resume_agent methods posting to /agents/{id}/register-managed and /managed-agents/{id}/{stop|resume} with per-method timeouts and standardized failure dicts.
stop and resume CLI commands
runagent/cli/commands/stop.py, runagent/cli/commands/resume.py
New Click commands initialize RunAgentSDK, verify configuration, call stop_agent/resume_agent, print success output with optional VM identifiers, derive nested error messages on failure, and support DISABLE_TRY_CATCH.
Deploy registration, CLI wiring, and gateway config fix
runagent/cli/commands/deploy.py, runagent/cli/main.py, templates/openclaw/gateway/runagent.config.json
Deploy calls register_managed_agent after gateway deployment and generalizes the gateway comment. CLI main.py registers stop and resume subcommands. OpenClaw gateway persistent_folders updated from rad/openclaw to .openclaw.

SuperBrowser Template

Layer / File(s) Summary
Template scaffold: config, env, and deploy alias
runagent/cli/commands/deploy.py, templates/superbrowser/default/runagent.config.json, templates/superbrowser/default/.env.example, templates/superbrowser/default/.gitignore
deploy.py maps the superbrowser alias to superbrowser/default. runagent.config.json defines agent metadata, a single run entrypoint, persistent folders (.superbrowser, .nanobot), and superbrowser runtime metadata. .env.example documents required LLM keys and optional feature toggles.
SuperBrowser serverless entrypoint
templates/superbrowser/default/main.py
Defines ENGINE_URL, _has_llm_credentials() checking API keys and nanobot config, _wait_for_engine() polling /health until 200 or 90 s timeout, _client() lazy-caching a SuperBrowser instance, and run() gating on credentials then normalizing the response dict including model_dump() for data.
README and openclaw/mcp cleanup
templates/superbrowser/default/README.md, templates/openclaw/mcp/requirements.txt
SuperBrowser README documents deployment, Python/TypeScript SDK usage, run() response shape, and serverless-only constraints. Removes openclaw-mcp from the openclaw/mcp requirements.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant CLI as runagent CLI
  participant SDK as RunAgentSDK
  participant RestClient
  participant Middleware as RunAgent Middleware

  rect rgba(70, 130, 180, 0.5)
    Note over CLI,Middleware: Deploy with gateway registration
    User->>CLI: runagent deploy (gateway agent)
    CLI->>SDK: deploy(...)
    SDK-->>CLI: agent_id
    CLI->>RestClient: register_managed_agent(agent_id)
    RestClient->>Middleware: POST /agents/{id}/register-managed
    Middleware-->>RestClient: {success: true}
    RestClient-->>CLI: registration result
  end

  rect rgba(60, 179, 113, 0.5)
    Note over CLI,Middleware: Stop/Resume lifecycle
    User->>CLI: runagent stop <agent_id>
    CLI->>RestClient: stop_agent(agent_id)
    RestClient->>Middleware: POST /managed-agents/{id}/stop
    Middleware-->>RestClient: {success: true, vm_id, vm_ip}
    RestClient-->>CLI: result
    CLI-->>User: Agent stopped, storage preserved

    User->>CLI: runagent resume <agent_id>
    CLI->>RestClient: resume_agent(agent_id)
    RestClient->>Middleware: POST /managed-agents/{id}/resume
    Middleware-->>RestClient: {success: true, vm_id, vm_ip}
    RestClient-->>CLI: result
    CLI-->>User: Agent resumed, storage reattached
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • runagent-dev/runagent#76: Both PRs introduce new runagent.config.json template files with an agent_id field, following the same template schema pattern.
  • runagent-dev/runagent#83: Both PRs modify the deployment success output handling in runagent/cli/commands/deploy.py, affecting the gateway credential/output branch.

Poem

🐇 Hop hop, the agents can pause and rest,
A stop command tucks them into their nest.
resume brings them back with storage intact,
SuperBrowser swoops in — that's a brand new pact!
The rabbit wired it all with twitching delight,
No gateway left unregistered tonight! 🌙

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rad/superbrowser

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RadeenXALNW
RadeenXALNW merged commit aaf9d33 into main Jun 20, 2026
1 of 2 checks 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.

1 participant