Skip to content

feat(sandbox): add agent passthrough subcommand for non-interactive openclaw access - #5397

Merged
cv merged 4 commits into
mainfrom
feat/sandbox-prompt-subcommand
Jun 15, 2026
Merged

feat(sandbox): add agent passthrough subcommand for non-interactive openclaw access#5397
cv merged 4 commits into
mainfrom
feat/sandbox-prompt-subcommand

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a nemoclaw <name> agent subcommand that runs one OpenClaw agent turn non-interactively inside a sandbox by passing through to openclaw agent ... over the existing openshell sandbox exec transport. Mirrors the shape of the already-shipped nemoclaw <name> sessions and nemoclaw <name> agents passthroughs so the upstream OpenClaw CLI flag surface stays the single source of truth.

Related Issue

Resolves #2643

Changes

  • New src/commands/sandbox/agent.ts oclif command; strict = false so all OpenClaw flags pass through verbatim.
  • New src/lib/actions/sandbox/agent/passthrough.ts action that reads the local sandbox registry, rejects Hermes with a redirect to the OpenAI-compatible API on port 8642 inside the sandbox, fails closed on registry-read errors, calls ensureLiveSandboxOrExit, then forwards ["openclaw", "agent", ...extraArgs] through execSandbox with tty: false so the wrapper never silently allocates a PTY.
  • Help text and token detection split into passthrough-help.ts so unit tests can import the pure helpers without pulling the runtime side of the chain.
  • Source-of-truth boundary block at the top of passthrough.ts documenting invalid state, source boundary, source-fix constraint, regression-test coverage, and the removal condition for the registry-read fallback.
  • sandbox:agent public-display entry registered with order 4.55 (between sandbox:exec at 4.5 and sandbox:download at 4.6).
  • Docs section in docs/reference/commands.mdx with per-agent <AgentOnly> blocks; commands-nemohermes.mdx regenerated via docs:sync-agent-variants.
  • Tests cover help-token detection, registry-driven Hermes rejection, verbatim argv forwarding (with --no-tty enforced), a clean registry miss falling back to OpenClaw, registry-read error failing closed without spawning OpenShell, and the empty-extra-args case.
  • Adjusted command-registry.test.ts counts for the added sandbox:agent entry (sandboxCommands 47 → 48, sandboxActionTokens 28 → 29) and added "agent" to the expected token set.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • New Features
    • Added a new sandbox:agent command to run a single non-interactive openclaw agent turn inside OpenClaw sandboxes, streaming output and forwarding flags verbatim.
    • Updated the public command display to include sandbox:agent under Sandbox Management.
  • Documentation
    • Added reference docs with usage examples, passthrough help behavior, and a Hermes alternative via port 8642 using the OpenAI-compatible streaming endpoint.
  • Tests
    • Added/updated CLI parsing, passthrough help detection, passthrough execution guards, and registry/forwarding behavior tests.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 268041c6-6cf8-42ba-9923-2e4692aa8958

📥 Commits

Reviewing files that changed from the base of the PR and between d685e9b and 450e543.

📒 Files selected for processing (4)
  • docs/reference/commands-nemohermes.mdx
  • docs/reference/commands.mdx
  • src/lib/actions/sandbox/agent/passthrough.test.ts
  • src/lib/actions/sandbox/agent/passthrough.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • docs/reference/commands.mdx
  • src/lib/actions/sandbox/agent/passthrough.test.ts
  • docs/reference/commands-nemohermes.mdx
  • src/lib/actions/sandbox/agent/passthrough.ts

📝 Walkthrough

Walkthrough

Adds a non-interactive sandbox:agent command that forwards arguments to openclaw agent inside OpenClaw sandboxes (streaming stdout and forwarding exit code). The passthrough fails closed on registry errors and rejects non-OpenClaw (Hermes) sandboxes with stderr guidance pointing to Hermes' OpenAI-compatible API on port 8642. Documentation and public-display registration were added.

Changes

Sandbox Agent Feature

Layer / File(s) Summary
Help token detection and display
src/lib/actions/sandbox/agent/passthrough-help.ts, src/lib/actions/sandbox/agent/passthrough-help.test.ts
hasAgentPassthroughHelpToken detects --help/-h before the -- separator; printAgentPassthroughHelp emits usage and OpenClaw-only note. Tests cover separator behavior and edge cases.
Agent passthrough execution and routing
src/lib/actions/sandbox/agent/passthrough.ts, src/lib/actions/sandbox/agent/passthrough.test.ts
runAgentPassthrough reads the sandbox agent from registry, fails closed on registry errors, rejects non-OpenClaw agents with stderr guidance and exit code 2, ensures sandbox is live (allowNonReadyPhase: true), and executes openclaw agent inside the sandbox with forwarded extraArgs and tty:false. Tests verify Hermes rejection, OpenClaw forwarding, registry-miss fallback, registry-read failure handling, and behavior when extraArgs is omitted.
CLI command definition and argument parsing
src/commands/sandbox/agent.ts, src/commands/sandbox/agent.test.ts
SandboxAgentCommand parses the sandbox name and passes remaining argv verbatim to runAgentPassthrough. It treats initial --help as CLI help and detects passthrough help tokens in remaining args. Tests assert argument forwarding and various help scenarios.
Registration, public display, and docs
src/lib/cli/public-display-defaults.ts, src/lib/cli/command-registry.test.ts, docs/reference/commands.mdx, docs/reference/commands-nemohermes.mdx
Adds sandbox:agent to public display defaults (Sandbox Management, order 4.55) and updates command-registry tests counts. Documents nemoclaw <name> agent behavior and documents nemohermes <name> agent as OpenClaw-only with Hermes workaround using port 8642 and the OpenAI-compatible API.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

area: sandbox

Suggested reviewers

  • cv

Poem

🐰 I hopped through flags and helped them pass,
Into sandboxes quiet as glass.
OpenClaw listens, Hermes gets shown,
A streamed reply, then a forwarded tone.
Happy hops — the agent's now on task!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: adding a new agent passthrough subcommand for non-interactive OpenClaw access in the sandbox.
Linked Issues check ✅ Passed The PR implements a CLI passthrough solution (#2643) that enables non-interactive OpenClaw access via the new nemoclaw <name> agent subcommand, forwarding args verbatim and rejecting Hermes with API guidance.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the agent passthrough feature: new command/action code, tests, documentation, registry updates, and public display entries—no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/sandbox-prompt-subcommand

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

@github-code-quality

github-code-quality Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the feat/sandbox-prompt-... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main feat/sandbox-prompt-... 450e543 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the feat/sandbox-prompt-... branch is 44%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main feat/sandbox-prompt-... 450e543 +/-
src/lib/state/o...oard-session.ts 90%
src/lib/inference/local.ts 77%
src/lib/sandbox/config.ts 72%
src/lib/inference/nim.ts 72%
src/lib/onboard/preflight.ts 64%
src/lib/state/sandbox.ts 55%
src/lib/onboard...er-gpu-patch.ts 50%
src/lib/actions...licy-channel.ts 49%
src/lib/policy/index.ts 48%
src/lib/onboard.ts 17%

Updated June 14, 2026 04:15 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

Copy link
Copy Markdown
Contributor

@laitingsheng laitingsheng added integration: openclaw OpenClaw integration behavior area: cli Command line interface, flags, terminal UX, or output feature PR adds or expands user-visible functionality labels Jun 13, 2026
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 1 worth checking, 0 nice ideas
Since last review: 0 prior items resolved, 0 still apply, 1 new item found

Review findings

🛠️ Needs attention

  • None.

🔎 Worth checking

  • Raw registry-read errors are printed to users (src/lib/actions/sandbox/agent/passthrough.ts:103): The fail-closed registry-read path writes the caught exception message directly to stderr. The added test intentionally exercises an `EACCES` message containing the local registry path, and future registry/load errors could expose host paths or other internal details in normal CLI output.
    • Recommendation: Print a sanitized failure reason such as the error code or a generic registry-read failure in normal output. If full diagnostics are useful, gate the raw exception message behind an explicit debug/verbose path.
    • Evidence: `rejectRegistryReadError` writes `Registry read error: ${message}` after `readSandboxAgentFromRegistry` catches arbitrary exceptions.

🌱 Nice ideas

  • None.
Consider writing more tests for
  • **Runtime validation** — Public sandbox-first translation: `translatePublicSandboxArgv("alpha", "agent", ["--agent", "work", "-m", "hi"])` resolves to `sandbox:agent` with args `["alpha", "--agent", "work", "-m", "hi"]`.. Unit coverage is good for the action guard paths, helper token parsing, no-tty enforcement, and direct oclif parse path. Because this is a user-facing sandbox exec passthrough, a few focused public-dispatch and fake-OpenShell boundary tests would improve confidence without adding framework layers.
  • **Runtime validation** — Public dispatch behavior: `nemoclaw alpha agent --agent work -m hi` reaches `runAgentPassthrough("alpha", { extraArgs: ["--agent", "work", "-m", "hi"] })` without dropping or reordering OpenClaw flags.. Unit coverage is good for the action guard paths, helper token parsing, no-tty enforcement, and direct oclif parse path. Because this is a user-facing sandbox exec passthrough, a few focused public-dispatch and fake-OpenShell boundary tests would improve confidence without adding framework layers.
  • **Runtime validation** — Help separator contract through the public surface: `nemoclaw alpha agent -- --help` forwards `["--", "--help"]` to OpenClaw rather than rendering wrapper help.. Unit coverage is good for the action guard paths, helper token parsing, no-tty enforcement, and direct oclif parse path. Because this is a user-facing sandbox exec passthrough, a few focused public-dispatch and fake-OpenShell boundary tests would improve confidence without adding framework layers.
  • **Runtime validation** — Fake OpenShell boundary: the wrapper ultimately builds `openshell sandbox exec --name alpha --no-tty -- openclaw agent ...` and preserves the remote stdout/stderr/exit-code behavior expected from `execSandbox`.. Unit coverage is good for the action guard paths, helper token parsing, no-tty enforcement, and direct oclif parse path. Because this is a user-facing sandbox exec passthrough, a few focused public-dispatch and fake-OpenShell boundary tests would improve confidence without adding framework layers.
  • **Acceptance clause:** We'd like to POST a prompt and receive a streamed response over HTTP/SSE, similar to how Claude Code and OpenAI's CLI can be driven non-interactively from another service. — add test evidence or identify existing coverage. No HTTP/SSE POST endpoint is added. The PR implements the issue's CLI alternative and documents stdout streaming from upstream `openclaw agent`; unit tests verify passthrough invocation but not end-to-end stream behavior.
  • **Acceptance clause:** **What would unlock this:** — add test evidence or identify existing coverage. The named alternatives under this heading are handled individually below; this PR implements the CLI-subcommand path, not the REST endpoint path.
  • **Acceptance clause:** A REST endpoint on the OpenShell gateway (port 8080) like `POST /v1/sandboxes/{name}/exec` accepting `{ prompt, max_turns?, stream? }` — add test evidence or identify existing coverage. This specific REST endpoint is not implemented. The issue presents it as one option before the sibling CLI-subcommand option, which this PR implements.
  • **Acceptance clause:** Bearer-token auth using the existing dashboard token would be ideal — add test evidence or identify existing coverage. No new HTTP endpoint or bearer-token flow is introduced. The implementation reuses the existing OpenShell exec transport, so this ideal HTTP-specific clause is not directly applicable to the selected CLI design.
Since last review details

Current findings:

  • Raw registry-read errors are printed to users (src/lib/actions/sandbox/agent/passthrough.ts:103): The fail-closed registry-read path writes the caught exception message directly to stderr. The added test intentionally exercises an `EACCES` message containing the local registry path, and future registry/load errors could expose host paths or other internal details in normal CLI output.
    • Recommendation: Print a sanitized failure reason such as the error code or a generic registry-read failure in normal output. If full diagnostics are useful, gate the raw exception message behind an explicit debug/verbose path.
    • Evidence: `rejectRegistryReadError` writes `Registry read error: ${message}` after `readSandboxAgentFromRegistry` catches arbitrary exceptions.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
docs/reference/commands-nemohermes.mdx (1)

437-437: ⚡ Quick win

Format stdout as inline code.

Wrap stdout in backticks to match the docs formatting rule for literal values.

As per coding guidelines, "CLI commands, file paths, flags, parameter names, and values must use inline code formatting."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/commands-nemohermes.mdx` at line 437, The docs sentence
contains the literal stdout value that needs inline code formatting; wrap stdout
in backticks (change "stdout" to "`stdout`") so the line reads: Send a single
prompt to the agent running inside a sandbox and stream the response to `stdout`
to comply with the inline code formatting rule for CLI-related literals.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/reference/commands-nemohermes.mdx`:
- Line 437: The docs sentence contains the literal stdout value that needs
inline code formatting; wrap stdout in backticks (change "stdout" to "`stdout`")
so the line reads: Send a single prompt to the agent running inside a sandbox
and stream the response to `stdout` to comply with the inline code formatting
rule for CLI-related literals.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cf41063f-e660-4f16-93b6-62dffacffc4c

📥 Commits

Reviewing files that changed from the base of the PR and between 37ab3ff and 9064cef.

📒 Files selected for processing (7)
  • docs/reference/commands-nemohermes.mdx
  • docs/reference/commands.mdx
  • src/commands/sandbox/prompt.test.ts
  • src/commands/sandbox/prompt.ts
  • src/lib/actions/sandbox/prompt.test.ts
  • src/lib/actions/sandbox/prompt.ts
  • src/lib/cli/public-display-defaults.ts

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: sandbox-operations-e2e, sessions-agents-cli-e2e
Optional E2E: agent-turn-latency-e2e, docs-validation-e2e

Dispatch hint: sandbox-operations-e2e,sessions-agents-cli-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • sandbox-operations-e2e (high (~60 min timeout)): Closest existing live sandbox coverage for a new sandbox command that depends on OpenShell sandbox execution and a real OpenClaw assistant path. It validates install/onboard, sandbox registry/status operations, and a real OpenClaw agent turn through a running sandbox.
  • sessions-agents-cli-e2e (medium-high (~60 min timeout)): Exercises adjacent host-side sandbox CLI passthrough surfaces (sessions and plural agents) and guards against regressions in sandbox action dispatch/JSON envelope handling after adding the new singular agent action token.

Optional E2E

  • agent-turn-latency-e2e (high (~120 min timeout)): Useful adjacent confidence for the underlying OpenClaw and Hermes real-turn paths documented by this PR, but it does not directly invoke the new nemoclaw <name> agent wrapper and is comparatively expensive.
  • docs-validation-e2e (low-medium): Optional documentation/CLI reference confidence because command reference docs and public display metadata changed; not merge-blocking for the runtime behavior because PR-level docs parity checks should cover the main drift risk.

New E2E recommendations

  • sandbox agent passthrough (high): No existing E2E directly invokes the new nemoclaw <name> agent wrapper. Existing tests exercise raw openclaw agent over SSH or adjacent agents/sessions commands, so they would not catch wrapper-specific argv forwarding, --no-tty, exit-code propagation, or command help behavior.
    • Suggested test: Add a sandbox-agent-passthrough-e2e that onboards an OpenClaw sandbox, runs nemoclaw <name> agent --json --session-id <id> -m <prompt>, asserts a valid streamed/JSON response and inherited exit code, and verifies flags after -- are forwarded as intended.
  • Hermes/OpenClaw agent boundary (high): The new fail-closed guard rejects Hermes sandboxes based on registry metadata before spawning OpenShell exec, but current E2E coverage does not validate that live Hermes users get the 8642 API redirect instead of an attempted openclaw agent call.
    • Suggested test: Extend the proposed sandbox agent passthrough E2E or add a Hermes variant that onboards a Hermes sandbox, runs nemohermes <name> agent -m ping, asserts exit code 2 and the port 8642 redirect text, and confirms no remote openclaw agent execution occurs.

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: sandbox-operations-e2e,sessions-agents-cli-e2e

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: ubuntu-repo-cloud-openclaw
Optional Vitest E2E scenarios: None

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: medium

Required Vitest E2E scenarios

  • ubuntu-repo-cloud-openclaw: The PR adds a new host-side OpenClaw sandbox command path that shells through OpenShell exec and reads the local sandbox registry. The smallest live-supported typed Vitest scenario that exercises the standard Ubuntu repo-current Docker OpenClaw onboarding, CLI build/install path, registry state, gateway health, and running sandbox boundary is ubuntu-repo-cloud-openclaw.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • src/commands/sandbox/agent.ts
  • src/lib/actions/sandbox/agent/passthrough-help.ts
  • src/lib/actions/sandbox/agent/passthrough.ts
  • src/lib/cli/public-display-defaults.ts

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 27475579458
Target ref: 9064cef0c44e68d0b2b1804817dba3026de0e1c2
Workflow ref: main
Requested jobs: sandbox-operations-e2e
Summary: 0 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
sandbox-operations-e2e ❌ failure

Failed jobs: sandbox-operations-e2e. Check run artifacts for logs.

…ough

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@laitingsheng laitingsheng changed the title feat(sandbox): add prompt subcommand for non-interactive openclaw access feat(sandbox): add agent passthrough subcommand for non-interactive openclaw access Jun 13, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (4)
docs/reference/commands.mdx (3)

550-550: 💤 Low value

Passive voice violation.

"The exit code is the remote command's exit code" uses passive voice. As per coding guidelines, use active voice.

Consider: "The command inherits the remote command's exit code" or "The remote command's exit code becomes the wrapper's exit code".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/commands.mdx` at line 550, Replace the passive sentence "The
exit code is the remote command's exit code" with an active-voice phrasing; for
example, change it to "The command inherits the remote command's exit code" or
"The remote command's exit code becomes the wrapper's exit code" so the
statement uses active voice and matches style guidelines.

Source: Coding guidelines


536-536: 💤 Low value

Passive voice violation.

"The command is a thin pass-through to..." uses passive voice. As per coding guidelines, use active voice.

Consider: "The command passes through to openclaw agent ... inside the sandbox" or "This command forwards arguments to openclaw agent ...".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/commands.mdx` at line 536, The sentence uses passive voice
("The command is a thin pass-through to `openclaw agent ...`"); rewrite it in
active voice — e.g. "This command forwards arguments to `openclaw agent ...`
inside the sandbox via `openshell sandbox exec`, with `HOME=/sandbox` so the
addressed agent profile resolves the same way as `connect`" — and replace the
original line in docs/reference/commands.mdx accordingly.

Source: Coding guidelines


557-557: 💤 Low value

Passive voice violation.

"agent is currently supported only on OpenClaw sandboxes" uses passive voice. As per coding guidelines, use active voice.

Consider: "OpenClaw sandboxes support the agent command; Hermes sandboxes do not" or "NemoClaw supports agent only on OpenClaw sandboxes".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/reference/commands.mdx` at line 557, The sentence uses passive voice;
replace it with an active-voice sentence that clearly states who supports the
feature. For example, change "`agent` is currently supported only on OpenClaw
sandboxes. Hermes already exposes an OpenAI-compatible HTTP API on port `8642`
inside the sandbox, so non-interactive use does not need a wrapper command." to
an active form such as "OpenClaw sandboxes support the `agent` command; Hermes
sandboxes do not — Hermes already exposes an OpenAI-compatible HTTP API on port
`8642` inside the sandbox, so non-interactive use does not need a wrapper
command." Make the change to the sentence containing `agent`, `OpenClaw`,
`Hermes`, and `8642` to ensure active voice and the same factual content.

Source: Coding guidelines

src/lib/actions/sandbox/agent/passthrough.ts (1)

44-45: 💤 Low value

Consider clarifying "agent" in the error message.

Line 45 says "agent is currently supported only on OpenClaw sandboxes" which could be ambiguous since Hermes is also an agent type. Consider "the agent command is currently supported" or "sandbox agent is currently supported" to make it clear you're referring to the CLI subcommand, not the agent type.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/actions/sandbox/agent/passthrough.ts` around lines 44 - 45, The error
string written by proc.stderr.write is ambiguous about "agent" — update the
message in passthrough.ts where proc.stderr.write is called so it explicitly
names the CLI subcommand (e.g., "the 'sandbox agent' command is currently
supported only on OpenClaw sandboxes") rather than the generic word "agent";
adjust the quoted example (got '${agent}') if needed to preserve the variable
but keep the clarified prefix so users know you mean the CLI subcommand.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/cli/public-display-defaults.ts`:
- Around line 253-259: The public-display entry for "sandbox:agent" duplicates
the display order 4.6 used by "sandbox:download", causing unpredictable
ordering; update the order value for "sandbox:agent" (the object with group
"Sandbox Management" and flags "[openclaw-agent-flags...]") to a unique number
such as 4.55 to place it between "sandbox:exec" (4.5) and "sandbox:download"
(4.6) (or 4.65 if you prefer it after download), ensuring no other entries share
that order.

---

Nitpick comments:
In `@docs/reference/commands.mdx`:
- Line 550: Replace the passive sentence "The exit code is the remote command's
exit code" with an active-voice phrasing; for example, change it to "The command
inherits the remote command's exit code" or "The remote command's exit code
becomes the wrapper's exit code" so the statement uses active voice and matches
style guidelines.
- Line 536: The sentence uses passive voice ("The command is a thin pass-through
to `openclaw agent ...`"); rewrite it in active voice — e.g. "This command
forwards arguments to `openclaw agent ...` inside the sandbox via `openshell
sandbox exec`, with `HOME=/sandbox` so the addressed agent profile resolves the
same way as `connect`" — and replace the original line in
docs/reference/commands.mdx accordingly.
- Line 557: The sentence uses passive voice; replace it with an active-voice
sentence that clearly states who supports the feature. For example, change
"`agent` is currently supported only on OpenClaw sandboxes. Hermes already
exposes an OpenAI-compatible HTTP API on port `8642` inside the sandbox, so
non-interactive use does not need a wrapper command." to an active form such as
"OpenClaw sandboxes support the `agent` command; Hermes sandboxes do not —
Hermes already exposes an OpenAI-compatible HTTP API on port `8642` inside the
sandbox, so non-interactive use does not need a wrapper command." Make the
change to the sentence containing `agent`, `OpenClaw`, `Hermes`, and `8642` to
ensure active voice and the same factual content.

In `@src/lib/actions/sandbox/agent/passthrough.ts`:
- Around line 44-45: The error string written by proc.stderr.write is ambiguous
about "agent" — update the message in passthrough.ts where proc.stderr.write is
called so it explicitly names the CLI subcommand (e.g., "the 'sandbox agent'
command is currently supported only on OpenClaw sandboxes") rather than the
generic word "agent"; adjust the quoted example (got '${agent}') if needed to
preserve the variable but keep the clarified prefix so users know you mean the
CLI subcommand.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 654c9e4f-34c6-4db4-b952-7fca8cb0f9c1

📥 Commits

Reviewing files that changed from the base of the PR and between 9064cef and ed5f3e6.

📒 Files selected for processing (9)
  • docs/reference/commands-nemohermes.mdx
  • docs/reference/commands.mdx
  • src/commands/sandbox/agent.test.ts
  • src/commands/sandbox/agent.ts
  • src/lib/actions/sandbox/agent/passthrough-help.test.ts
  • src/lib/actions/sandbox/agent/passthrough-help.ts
  • src/lib/actions/sandbox/agent/passthrough.test.ts
  • src/lib/actions/sandbox/agent/passthrough.ts
  • src/lib/cli/public-display-defaults.ts
✅ Files skipped from review due to trivial changes (2)
  • src/lib/actions/sandbox/agent/passthrough-help.test.ts
  • docs/reference/commands-nemohermes.mdx

Comment thread src/lib/cli/public-display-defaults.ts
…or agent passthrough

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…law reject

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@cv
cv merged commit 8c9ec67 into main Jun 15, 2026
45 checks passed
@cv
cv deleted the feat/sandbox-prompt-subcommand branch June 15, 2026 21:12
@cv cv added the v0.0.66 label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output feature PR adds or expands user-visible functionality integration: openclaw OpenClaw integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: non-interactive exec API for OpenClaw inside sandbox

3 participants