Skip to content

feat(cli): add sandbox sessions and agents subcommand groups#4615

Merged
cv merged 25 commits into
mainfrom
feat-sessions-cli-group
Jun 2, 2026
Merged

feat(cli): add sandbox sessions and agents subcommand groups#4615
cv merged 25 commits into
mainfrom
feat-sessions-cli-group

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds two host-side sandbox-first subcommand groups: nemoclaw <name> sessions (list / reset / delete) and nemoclaw <name> agents (add / delete). sessions list and the agents pair are thin pass-throughs to openclaw inside the sandbox via openshell sandbox exec. sessions reset and sessions delete go through the OpenClaw gateway sessions.reset / sessions.delete RPCs so the gateway owns archival, lock handling, and lifecycle events; the host never edits sessions.json directly.

Related Issue

Closes #834.

Related: #4560 — complementary bake-time path for secondary agents via NEMOCLAW_EXTRA_AGENTS_JSON.

Changes

  • src/lib/actions/sandbox/sessions/: new action module split into paths.ts (agent-id, session-key validators, canonical-key builder, parseAgentIdFromSessionKey, DEFAULT_AGENT_ID), gateway-rpc-envelope.ts (pure JSON-envelope parser), gateway-rpc.ts (openshell sandbox exec -- openclaw gateway call <method> --params <json> --json dispatcher + shared error envelope), passthrough.ts (forwards to openclaw sessions ...), reset.ts (gateway sessions.reset adapter), delete.ts (gateway sessions.delete adapter).
  • src/lib/actions/sandbox/agents/passthrough.ts: new action module forwarding to openclaw agents add / openclaw agents delete via openshell sandbox exec.
  • src/commands/sandbox/sessions.ts + src/commands/sandbox/sessions/{list,reset,delete}.ts: four new oclif command adapters. The parent defaults to openclaw sessions (list semantics). reset and delete accept <key> plus --agent <id> to scope an alias to a non-default agent; mismatched --agent + canonical-key pairs are refused. reset adds --reason new|reset, delete adds --keep-transcript; both accept --json and --verbose.
  • src/commands/sandbox/agents/{add,delete}.ts: two new oclif command adapters forwarding to the OpenClaw in-sandbox CLI.
  • src/lib/actions/sandbox/sessions/{paths,gateway-rpc}.test.ts: 13 unit tests covering validator rejection of shell metacharacters, canonical-key composition, agent-id extraction from canonical keys, and the gateway-envelope parser's tolerance of noisy stdout.
  • src/lib/cli/public-display-{layout,sessions,agents}.ts + src/lib/cli/public-display-defaults.ts: extract the layout type into a shared module and register display metadata for the six new commands under Sandbox Management.
  • src/lib/cli/command-registry.test.ts: bump the hardcoded command counts (64 -> 70 total, 36 -> 42 sandbox, 52 -> 58 visible, 23 -> 25 action tokens) and add agents + sessions to the expected sandbox-action set.
  • docs/reference/commands.mdx: new ### nemoclaw <name> {agents,sessions} sections with command grammar, examples, and the --agent / --reason / --keep-transcript flag tables.
  • test/e2e/test-sessions-agents-cli.sh + .github/workflows/nightly-e2e.yaml sessions-agents-cli-e2e job: end-to-end coverage that onboards a sandbox, seeds a session, exercises sessions / sessions list / sessions reset / agents add + delete passthrough, and asserts sessions delete on a non-main session via the gateway.

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

    • Sandbox CLI: added agents and sessions commands (add, delete, list, reset) with agent scoping, transcript controls, passthrough behavior, and JSON/verbose output; gateway-RPC and session key helpers.
  • Documentation

    • Added command reference entries and CLI public display/layout updates for sandbox agents and sessions.
  • Tests

    • Added E2E script for sessions/agents and unit tests for gateway parsing, session paths, reset/delete flows, and CLI translation.
  • Chores

    • Nightly CI: new sessions-agents-cli E2E job added and wired into failure/PR/scorecard reporting.

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

coderabbitai Bot commented Jun 1, 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: abd82bb6-4154-4a2f-9d94-bc4439ab5d05

📥 Commits

Reviewing files that changed from the base of the PR and between 36a9a0d and 2de6506.

📒 Files selected for processing (9)
  • src/commands/sandbox/agents.ts
  • src/lib/actions/sandbox/sessions/delete.test.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc.test.ts
  • src/lib/actions/sandbox/sessions/paths.test.ts
  • src/lib/actions/sandbox/sessions/paths.ts
  • src/lib/actions/sandbox/sessions/reset.test.ts
  • src/lib/actions/sandbox/sessions/reset.ts
  • test/e2e/test-sessions-agents-cli.sh
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/commands/sandbox/agents.ts
  • src/lib/actions/sandbox/sessions/paths.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc.test.ts
  • src/lib/actions/sandbox/sessions/delete.test.ts
  • src/lib/actions/sandbox/sessions/reset.test.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts
  • src/lib/actions/sandbox/sessions/reset.ts
  • test/e2e/test-sessions-agents-cli.sh

📝 Walkthrough

Walkthrough

Adds sandboxed CLI commands and helpers for OpenClaw agents and sessions, gateway-RPC parsing/calls, session key validation, public-display layout, unit and E2E tests, documentation, and a nightly E2E workflow job.

Changes

Sessions and Agents CLI

Layer / File(s) Summary
Session key validation and tests
src/lib/actions/sandbox/sessions/paths.ts, src/lib/actions/sandbox/sessions/paths.test.ts
validateAgentId/validateSessionKey, parseAgentIdFromSessionKey, buildCanonicalSessionKey, and unit tests for accepted/rejected forms.
Gateway envelope parsing and tests
src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts, src/lib/actions/sandbox/sessions/gateway-rpc.test.ts
Tolerant parser parseGatewayCallPayload that extracts JSON gateway envelopes from noisy stdout; tests cover single-line, multi-line, embedded JSON, and malformed cases.
Gateway RPC caller
src/lib/actions/sandbox/sessions/gateway-rpc.ts
callOpenclawGateway runs openclaw gateway call ... --json inside a sandbox, enforces exit-status and envelope parsing, and returns { payload, rawOutput }.
Sessions reset action and command
src/lib/actions/sandbox/sessions/reset.ts, src/commands/sandbox/sessions/reset.ts, src/lib/actions/sandbox/sessions/reset.test.ts
resetSandboxSession normalizes reason, validates agent/key scoping, canonicalizes keys, invokes sessions.reset via gateway RPC, validates payload shape, and prints JSON/human output; CLI sandbox:sessions:reset added.
Sessions delete action and command
src/lib/actions/sandbox/sessions/delete.ts, src/commands/sandbox/sessions/delete.ts, src/lib/actions/sandbox/sessions/delete.test.ts
deleteSandboxSession validates/canonicalizes keys, maps --keep-transcript to deleteTranscript, calls sessions.delete gateway RPC, validates responses, and emits JSON/human output; CLI sandbox:sessions:delete added.
Sessions passthrough and list commands
src/lib/actions/sandbox/sessions/passthrough.ts, src/commands/sandbox/sessions.ts, src/commands/sandbox/sessions/list.ts
runSessionsPassthrough forwards openclaw sessions [list] into a sandbox with help-token detection; commands parse sandbox name and forward args.
Agents passthrough and commands
src/lib/actions/sandbox/agents/passthrough.ts, src/commands/sandbox/agents/add.ts, src/commands/sandbox/agents/delete.ts, src/commands/sandbox/agents.ts
runAgentsPassthrough forwards `openclaw agents add
CLI public display layout and defaults
src/lib/cli/public-display-layout.ts, src/lib/cli/public-display-agents.ts, src/lib/cli/public-display-sessions.ts, src/lib/cli/public-display-defaults.ts
Introduce PublicDisplayLayout type and register public display entries for sandbox agents and sessions; compose defaults from modular mappings.
Public-argv translation and tests
src/lib/cli/public-argv-translation.ts, src/lib/cli/public-argv-translation.test.ts
Treat non-strict sandbox parent commands specially so sessions/agents map to parent passthrough when appropriate; tests added for passthrough, subcommand routing, and help routing.
Command registry test adjustments
src/lib/cli/command-registry.test.ts
Update test expectations for expanded command counts and include the new sessions action token.
Command reference documentation
docs/reference/commands.mdx
Document nemoclaw <name> agents and sessions commands (add/delete/list/reset/delete) with usage, forwarded flags, gateway semantics, and examples.
End-to-end test script and CI job
test/e2e/test-sessions-agents-cli.sh, .github/workflows/nightly-e2e.yaml, .coderabbit.yaml
Add Bash E2E script exercising sessions and agents flows; add sessions-agents-cli-e2e nightly job (60m timeout, artifact path, env JSON, secrets) and CodeRabbit path instructions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

Sandbox, OpenShell

Suggested reviewers

  • cv
  • ericksoa
  • cjagwani

Poem

🐰 I hopped through code with whiskers bright,
Sandboxes hum and keys set right.
Agents added, sessions reset,
Tests and CI join the duet.
The rabbit dances — E2E takes flight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.22% 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 title 'feat(cli): add sandbox sessions and agents subcommand groups' clearly and concisely summarizes the main change—introducing two new sandbox-focused oclif subcommand groups for sessions and agents management.
Linked Issues check ✅ Passed The PR fully implements the objective from #834 by adding nemoclaw <name> sessions reset command that invokes the OpenClaw gateway RPC sessions.reset, eliminating the need for manual filesystem edits and providing session recovery without shell access.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the sessions and agents subcommand groups. The E2E test, workflow job, documentation, and CLI infrastructure are all integral to the feature delivery and testing.

✏️ 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-sessions-cli-group

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

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

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

Dispatch hint: sessions-agents-cli-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • sessions-agents-cli-e2e (high; provisions a sandbox and has a 60 minute job timeout): Direct coverage for the new public sessions/agents CLI groups: live sandbox onboarding, public argv routing, openclaw sessions passthrough, gateway RPC envelope round-trip for sessions reset/sessions delete, and agents add/agents delete passthrough against a real OpenClaw runtime.

Optional E2E

  • sandbox-operations-e2e (high; provisions sandboxes and has a 60 minute job timeout): Useful broader smoke because public-argv-translation.ts and command registry/display plumbing changed. This checks existing sandbox command dispatch and lifecycle operations for regressions outside the new sessions/agents surface.
  • docs-validation-e2e (moderate): Validates the updated command reference docs, including new sessions/agents command documentation, but does not need to block merge if runtime E2E passes.

New E2E recommendations

  • None.

Dispatch hint

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

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: ubuntu-repo-cloud-openclaw
Optional scenario E2E: wsl-repo-cloud-openclaw, macos-repo-cloud-openclaw

Dispatch required scenario E2E:

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

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: medium

Required scenario E2E

  • ubuntu-repo-cloud-openclaw: Host-side OpenClaw sandbox CLI and public argv/display changes can affect repo-checkout install, CLI help/availability, and live-sandbox command routing exercised by the Ubuntu OpenClaw smoke and baseline-onboarding scenario.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Optional scenario E2E

  • wsl-repo-cloud-openclaw: Optional adjacent platform coverage for the same repo-checkout OpenClaw CLI surface under WSL; useful if reviewers want cross-platform confidence for public command translation/display changes.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=wsl-repo-cloud-openclaw
  • macos-repo-cloud-openclaw: Optional adjacent platform coverage for repo-checkout CLI smoke/help behavior on macOS; special-runner/platform scenario, so not required for the primary OpenClaw sandbox CLI change.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=macos-repo-cloud-openclaw

Relevant changed files

  • src/commands/sandbox/agents.ts
  • src/commands/sandbox/agents/add.ts
  • src/commands/sandbox/agents/delete.ts
  • src/commands/sandbox/sessions.ts
  • src/commands/sandbox/sessions/delete.ts
  • src/commands/sandbox/sessions/list.ts
  • src/commands/sandbox/sessions/reset.ts
  • src/lib/actions/sandbox/agents/passthrough.ts
  • src/lib/actions/sandbox/sessions/delete.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc.ts
  • src/lib/actions/sandbox/sessions/passthrough.ts
  • src/lib/actions/sandbox/sessions/paths.ts
  • src/lib/cli/public-argv-translation.ts
  • src/lib/cli/public-display-agents.ts
  • src/lib/cli/public-display-defaults.ts
  • src/lib/cli/public-display-layout.ts
  • src/lib/cli/public-display-sessions.ts

@laitingsheng laitingsheng added integration: openclaw OpenClaw integration behavior NemoClaw CLI labels Jun 1, 2026
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

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

Review findings

🛠️ Needs attention

  • Secret-bearing E2E job can run target-ref script code (.github/workflows/nightly-e2e.yaml:525): The new sessions-agents-cli-e2e job checks out inputs.target_ref || github.ref and runs test/e2e/test-sessions-agents-cli.sh while exporting NVIDIA_API_KEY. The workflow comment describes schedule/manual dispatch as trusted paths, but the trusted e2e-advisor dispatcher can invoke nightly-e2e.yaml for eligible same-repo PRs with target_ref set to the PR head SHA, so PR-controlled script and install code can execute with the repository E2E credential.
    • Recommendation: Make this job secret-free, restrict it to already-trusted refs, exclude it from automatic PR-head dispatch, move secret-bearing logic into trusted workflow/action code, or add an enforced policy that this job is never auto-dispatched with target_ref from a PR head. Keep github_token disabled unless a verified need is introduced.
    • Evidence: nightly-e2e.yaml sets ref: ${{ inputs.target_ref || github.ref }}, script: test/e2e/test-sessions-agents-cli.sh, nvidia_api_key: true, and github_token: false. .github/workflows/e2e-script.yaml checks out inputs.ref into repo and runs the requested script with NVIDIA_API_KEY in env. tools/e2e-advisor/dispatch.mts builds targetRef from pr.head?.sha || pr.head?.ref.
  • Add openclaw sessions reset <session-id> subcommand #834 corrupted-session recovery evidence is still non-concrete (src/lib/actions/sandbox/sessions/reset.ts:45): Issue Add openclaw sessions reset <session-id> subcommand #834 and its comments ask for a reset path that recovers corrupted sessions, stale lock files, manual sessions.json/jsonl deletion states, and a clean next message without sandbox shell access. This PR adds the host-side command and correctly delegates file mutation to OpenClaw, but the changed tests still exercise the healthy wrapper/gateway path rather than the corrupted-store, stale-lock, and clean-follow-up acceptance path. The source-boundary comment cites upstream OpenClaw package tests generically rather than concrete, versioned evidence tied to the pinned OpenClaw package.
    • Recommendation: Before closing Add openclaw sessions reset <session-id> subcommand #834, add in-repo runtime coverage for stale .jsonl.lock cleanup, corrupt or missing sessions.json recovery, transcript/session reset behavior, and a post-reset clean next message; or cite authoritative upstream regression evidence with the concrete OpenClaw package version/commit and exact test paths tied to agents/openclaw/manifest.yaml expected_version.
    • Evidence: Issue body: "When a session becomes corrupted ... the only recovery path is to manually delete .jsonl and sessions.json files from inside the sandbox". Comment clauses include "Clear all lock files", rm -f sessions.json, rm -f *.jsonl, rm -f *.jsonl.lock, and "The agent picks up a clean session on the next message." test/e2e/test-sessions-agents-cli.sh says recovery semantics live upstream and does not create stale locks, corrupt sessions.json, delete jsonl files, or send a post-reset message. reset.ts cites openclaw@expected_version and test/sessions/reset.test.* generically.

🔎 Worth checking

  • Source-of-truth review needed: src/lib/actions/sandbox/sessions/reset.ts session reset recovery boundary: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Evidence: reset.ts cites agents/openclaw/manifest.yaml expected_version currently 2026.5.22 and `test/sessions/reset.test.*`, but the PR does not include concrete upstream artifact/commit/test evidence or an in-repo runtime corruption proof.
  • Source-of-truth review needed: src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts tolerant gateway response parser: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Evidence: gateway-rpc-envelope.ts describes tolerance for leading log noise and raw handler return values; gateway-rpc.test.ts covers many parser cases, but no source-fix constraint or versioned removal condition is stated.
  • Tolerant gateway parser lacks a source-fix and removal contract (src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts:11): The parser intentionally accepts raw handler payloads, leading warning/log noise, compact JSON lines, and embedded pretty-printed JSON. The tests cover the parser behavior well, but the source-of-truth note does not fully answer why OpenClaw cannot normalize machine output here or when this tolerant parsing workaround can be removed. The loose acceptance of any object with ok or error also depends on logs never containing a response-shaped object.
    • Recommendation: Document the upstream output contract that forces this tolerance, why OpenClaw cannot emit stable machine-only JSON for --json here, and a removal condition such as a minimum OpenClaw version with stable machine-only JSON output. Keep the negative tests that reject unrelated JSON log objects and consider a stricter delimiter/envelope if upstream output can contain response-shaped logs.
    • Evidence: gateway-rpc-envelope.ts says the parser is tolerant about leading log noise and raw handler return values. gateway-rpc.test.ts covers raw {ok:true}, raw errors, noisy output, multi-line JSON, multiple JSON blocks, and unrelated JSON rejection. No minimum-version or source-fix/removal condition is stated for the parser.
  • Gateway parse failures echo raw gateway output (src/lib/actions/sandbox/sessions/gateway-rpc.ts:55): On parse failures and unexpected reset/delete payloads, the CLI prints the raw gateway output. This is useful local diagnostics and not a confirmed leak in the current code path, but gateway warning or error streams may include credentials, tokens, message content, or internal paths if upstream output changes.
    • Recommendation: Bound and redact raw gateway diagnostics, or only print raw output under a verbose/debug mode if OpenClaw payloads can include credentials, tokens, or message content in future.
    • Evidence: gateway-rpc.ts prints result.output when the gateway exits non-zero or parsing fails. reset.ts and delete.ts print rawOutput.trim() when the gateway returns an unexpected payload.

🌱 Nice ideas

  • None.
Since last review details

Current findings:

  • Source-of-truth review needed: src/lib/actions/sandbox/sessions/reset.ts session reset recovery boundary: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Evidence: reset.ts cites agents/openclaw/manifest.yaml expected_version currently 2026.5.22 and `test/sessions/reset.test.*`, but the PR does not include concrete upstream artifact/commit/test evidence or an in-repo runtime corruption proof.
  • Source-of-truth review needed: src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts tolerant gateway response parser: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Evidence: gateway-rpc-envelope.ts describes tolerance for leading log noise and raw handler return values; gateway-rpc.test.ts covers many parser cases, but no source-fix constraint or versioned removal condition is stated.
  • Secret-bearing E2E job can run target-ref script code (.github/workflows/nightly-e2e.yaml:525): The new sessions-agents-cli-e2e job checks out inputs.target_ref || github.ref and runs test/e2e/test-sessions-agents-cli.sh while exporting NVIDIA_API_KEY. The workflow comment describes schedule/manual dispatch as trusted paths, but the trusted e2e-advisor dispatcher can invoke nightly-e2e.yaml for eligible same-repo PRs with target_ref set to the PR head SHA, so PR-controlled script and install code can execute with the repository E2E credential.
    • Recommendation: Make this job secret-free, restrict it to already-trusted refs, exclude it from automatic PR-head dispatch, move secret-bearing logic into trusted workflow/action code, or add an enforced policy that this job is never auto-dispatched with target_ref from a PR head. Keep github_token disabled unless a verified need is introduced.
    • Evidence: nightly-e2e.yaml sets ref: ${{ inputs.target_ref || github.ref }}, script: test/e2e/test-sessions-agents-cli.sh, nvidia_api_key: true, and github_token: false. .github/workflows/e2e-script.yaml checks out inputs.ref into repo and runs the requested script with NVIDIA_API_KEY in env. tools/e2e-advisor/dispatch.mts builds targetRef from pr.head?.sha || pr.head?.ref.
  • Add openclaw sessions reset <session-id> subcommand #834 corrupted-session recovery evidence is still non-concrete (src/lib/actions/sandbox/sessions/reset.ts:45): Issue Add openclaw sessions reset <session-id> subcommand #834 and its comments ask for a reset path that recovers corrupted sessions, stale lock files, manual sessions.json/jsonl deletion states, and a clean next message without sandbox shell access. This PR adds the host-side command and correctly delegates file mutation to OpenClaw, but the changed tests still exercise the healthy wrapper/gateway path rather than the corrupted-store, stale-lock, and clean-follow-up acceptance path. The source-boundary comment cites upstream OpenClaw package tests generically rather than concrete, versioned evidence tied to the pinned OpenClaw package.
    • Recommendation: Before closing Add openclaw sessions reset <session-id> subcommand #834, add in-repo runtime coverage for stale .jsonl.lock cleanup, corrupt or missing sessions.json recovery, transcript/session reset behavior, and a post-reset clean next message; or cite authoritative upstream regression evidence with the concrete OpenClaw package version/commit and exact test paths tied to agents/openclaw/manifest.yaml expected_version.
    • Evidence: Issue body: "When a session becomes corrupted ... the only recovery path is to manually delete .jsonl and sessions.json files from inside the sandbox". Comment clauses include "Clear all lock files", rm -f sessions.json, rm -f *.jsonl, rm -f *.jsonl.lock, and "The agent picks up a clean session on the next message." test/e2e/test-sessions-agents-cli.sh says recovery semantics live upstream and does not create stale locks, corrupt sessions.json, delete jsonl files, or send a post-reset message. reset.ts cites openclaw@expected_version and test/sessions/reset.test.* generically.
  • Tolerant gateway parser lacks a source-fix and removal contract (src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts:11): The parser intentionally accepts raw handler payloads, leading warning/log noise, compact JSON lines, and embedded pretty-printed JSON. The tests cover the parser behavior well, but the source-of-truth note does not fully answer why OpenClaw cannot normalize machine output here or when this tolerant parsing workaround can be removed. The loose acceptance of any object with ok or error also depends on logs never containing a response-shaped object.
    • Recommendation: Document the upstream output contract that forces this tolerance, why OpenClaw cannot emit stable machine-only JSON for --json here, and a removal condition such as a minimum OpenClaw version with stable machine-only JSON output. Keep the negative tests that reject unrelated JSON log objects and consider a stricter delimiter/envelope if upstream output can contain response-shaped logs.
    • Evidence: gateway-rpc-envelope.ts says the parser is tolerant about leading log noise and raw handler return values. gateway-rpc.test.ts covers raw {ok:true}, raw errors, noisy output, multi-line JSON, multiple JSON blocks, and unrelated JSON rejection. No minimum-version or source-fix/removal condition is stated for the parser.
  • Gateway parse failures echo raw gateway output (src/lib/actions/sandbox/sessions/gateway-rpc.ts:55): On parse failures and unexpected reset/delete payloads, the CLI prints the raw gateway output. This is useful local diagnostics and not a confirmed leak in the current code path, but gateway warning or error streams may include credentials, tokens, message content, or internal paths if upstream output changes.
    • Recommendation: Bound and redact raw gateway diagnostics, or only print raw output under a verbose/debug mode if OpenClaw payloads can include credentials, tokens, or message content in future.
    • Evidence: gateway-rpc.ts prints result.output when the gateway exits non-zero or parsing fails. reset.ts and delete.ts print rawOutput.trim() when the gateway returns an unexpected payload.

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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/nightly-e2e.yaml (1)

476-482: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Incorrect comment block - describes the wrong job.

The comment block describes "Channels add/remove lifecycle E2E (#3462 Test 2)" and discusses Telegram network policy presets, but the job that follows is sessions-agents-cli-e2e, which tests the sessions and agents CLI surface.

This appears to be a copy-paste error from the channels-add-remove-e2e job definition.

📝 Proposed fix

Replace the incorrect comment with:

-  # ── Channels add/remove lifecycle E2E (`#3462` Test 2) ────────────────
-  # Regression coverage for `#3437` (channels add must auto-apply the matching
-  # network policy preset so the bridge boots with egress to its upstream API)
-  # and `#3671` (channels remove must detach providers, un-apply the preset,
-  # and survive a follow-up rebuild without being silently re-added from
-  # shell env). Telegram-only — the other paste-token channels walk the same
-  # KNOWN_CHANNELS + preset lookup code path.
+  # ── Sessions and Agents CLI E2E (`#834`) ────────────────────────
+  # Validates the host-side CLI surface for managing OpenClaw agents and
+  # conversation sessions within sandboxes. Covers sessions list/reset/delete
+  # via gateway RPC and agents add/delete passthrough commands.
   sessions-agents-cli-e2e:
🤖 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 @.github/workflows/nightly-e2e.yaml around lines 476 - 482, The comment above
the sessions-agents-cli-e2e job is incorrect and describes the
channels-add-remove-e2e test; replace that copy-pasted block with a short,
accurate comment describing the sessions-agents-cli-e2e job purpose (sessions
and agents CLI E2E), ensuring references to the job name sessions-agents-cli-e2e
are preserved and removing any Telegram/network policy/preset mentions that
belong to channels-add-remove-e2e.
🧹 Nitpick comments (1)
test/e2e/test-sessions-agents-cli.sh (1)

213-215: 💤 Low value

Consider breaking down the complex Python one-liner for better readability.

This three-line pipeline combines CLI invocation, JSON parsing, list comprehension, and string filtering in a single expression. If the session discovery fails, debugging will be challenging.

Consider refactoring to separate steps or adding intermediate variables for clarity.

🤖 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 `@test/e2e/test-sessions-agents-cli.sh` around lines 213 - 215, The current
three-line pipeline that sets the variable key (running nemoclaw "$SANDBOX_NAME"
sessions list --agent "$TEST_AGENT_ID" --json piped into a python3 -c one-liner)
is hard to read and debug; refactor by splitting it into clear steps: capture
the raw JSON output from the nemoclaw command into an intermediate variable
(e.g., raw_sessions), then parse/filter that JSON in a separate, small python or
jq step to extract the desired session key (assign result to key), and ensure
you preserve the same fallback behavior (suppressing errors and defaulting to
empty when not found); update references to the python3 -c snippet and the key
variable so logs or set -x can show intermediate values for easier debugging.
🤖 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 `@docs/reference/commands.mdx`:
- Around line 852-855: Replace the inline console code blocks that include
prompt markers with copyable shell code blocks: for each code block showing "$
nemoclaw my-assistant ..." (the console blocks containing the two example
commands and the other mentioned blocks), change the fenced block language from
"console" to "bash" (or "sh") and remove the leading "$ " prompt from each line
so the block contains just the commands (e.g., "nemoclaw my-assistant agents
add" and "nemoclaw my-assistant agents add work --model gpt-4o"). Apply the same
conversion to all other newly added command-only console blocks listed in the
comment.

---

Outside diff comments:
In @.github/workflows/nightly-e2e.yaml:
- Around line 476-482: The comment above the sessions-agents-cli-e2e job is
incorrect and describes the channels-add-remove-e2e test; replace that
copy-pasted block with a short, accurate comment describing the
sessions-agents-cli-e2e job purpose (sessions and agents CLI E2E), ensuring
references to the job name sessions-agents-cli-e2e are preserved and removing
any Telegram/network policy/preset mentions that belong to
channels-add-remove-e2e.

---

Nitpick comments:
In `@test/e2e/test-sessions-agents-cli.sh`:
- Around line 213-215: The current three-line pipeline that sets the variable
key (running nemoclaw "$SANDBOX_NAME" sessions list --agent "$TEST_AGENT_ID"
--json piped into a python3 -c one-liner) is hard to read and debug; refactor by
splitting it into clear steps: capture the raw JSON output from the nemoclaw
command into an intermediate variable (e.g., raw_sessions), then parse/filter
that JSON in a separate, small python or jq step to extract the desired session
key (assign result to key), and ensure you preserve the same fallback behavior
(suppressing errors and defaulting to empty when not found); update references
to the python3 -c snippet and the key variable so logs or set -x can show
intermediate values for easier debugging.
🪄 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: a9b750aa-a851-44f2-8d15-292ac2889a65

📥 Commits

Reviewing files that changed from the base of the PR and between 0578c72 and 12975c1.

📒 Files selected for processing (23)
  • .github/workflows/nightly-e2e.yaml
  • docs/reference/commands.mdx
  • src/commands/sandbox/agents/add.ts
  • src/commands/sandbox/agents/delete.ts
  • src/commands/sandbox/sessions.ts
  • src/commands/sandbox/sessions/delete.ts
  • src/commands/sandbox/sessions/list.ts
  • src/commands/sandbox/sessions/reset.ts
  • src/lib/actions/sandbox/agents/passthrough.ts
  • src/lib/actions/sandbox/sessions/delete.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc.test.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc.ts
  • src/lib/actions/sandbox/sessions/passthrough.ts
  • src/lib/actions/sandbox/sessions/paths.test.ts
  • src/lib/actions/sandbox/sessions/paths.ts
  • src/lib/actions/sandbox/sessions/reset.ts
  • src/lib/cli/command-registry.test.ts
  • src/lib/cli/public-display-agents.ts
  • src/lib/cli/public-display-defaults.ts
  • src/lib/cli/public-display-layout.ts
  • src/lib/cli/public-display-sessions.ts
  • test/e2e/test-sessions-agents-cli.sh

Comment thread docs/reference/commands.mdx Outdated

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/nightly-e2e.yaml (1)

489-507: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add missing .coderabbit.yaml path_instructions for sessions-agents-cli-e2e
.coderabbit.yaml currently has no path_instructions (and no sessions-agents-cli-e2e reference) covering test/e2e/test-sessions-agents-cli.sh or the sessions/agents sandbox source paths for this job—so those changes won’t get routed to the intended E2E review. Add a matching path_instructions entry for the job’s covered paths (including the script under test/e2e/).

🤖 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 @.github/workflows/nightly-e2e.yaml around lines 489 - 507, Add a
path_instructions entry in .coderabbit.yaml for the sessions-agents-cli-e2e job
so changes to the test script and related sandbox sources trigger the E2E
review: locate the job name sessions-agents-cli-e2e in the workflow and add a
path_instructions block that includes the test script path
test/e2e/test-sessions-agents-cli.sh plus relevant sessions/ and agents/ source
paths (e.g., sessions/**, agents/** or other repo-specific dirs used by the
sandbox) so those files are routed to this E2E review.
🤖 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.

Outside diff comments:
In @.github/workflows/nightly-e2e.yaml:
- Around line 489-507: Add a path_instructions entry in .coderabbit.yaml for the
sessions-agents-cli-e2e job so changes to the test script and related sandbox
sources trigger the E2E review: locate the job name sessions-agents-cli-e2e in
the workflow and add a path_instructions block that includes the test script
path test/e2e/test-sessions-agents-cli.sh plus relevant sessions/ and agents/
source paths (e.g., sessions/**, agents/** or other repo-specific dirs used by
the sandbox) so those files are routed to this E2E review.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c455d86b-a503-4f47-8438-d413e37caf84

📥 Commits

Reviewing files that changed from the base of the PR and between ae21f7b and 8086ec4.

📒 Files selected for processing (4)
  • .github/workflows/nightly-e2e.yaml
  • src/lib/actions/sandbox/sessions/gateway-rpc.test.ts
  • src/lib/actions/sandbox/sessions/reset.ts
  • test/e2e/test-sessions-agents-cli.sh
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/lib/actions/sandbox/sessions/gateway-rpc.test.ts
  • src/lib/actions/sandbox/sessions/reset.ts
  • test/e2e/test-sessions-agents-cli.sh

@laitingsheng laitingsheng added v0.0.57 Release target and removed v0.0.57 Release target labels Jun 2, 2026
…docs

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 26805558920
Target ref: feat-sessions-cli-group
Workflow ref: feat-sessions-cli-group
Requested jobs: sessions-agents-cli-e2e
Summary: 0 passed, 1 failed, 0 skipped

Job Result
sessions-agents-cli-e2e ❌ failure

Failed jobs: sessions-agents-cli-e2e. Check run artifacts for logs.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 26811158348
Target ref: feat-sessions-cli-group
Requested jobs: sessions-agents-cli-e2e
Summary: 0 passed, 1 failed, 0 skipped

Job Result
sessions-agents-cli-e2e ❌ failure

Failed jobs: sessions-agents-cli-e2e. Check run artifacts for logs.

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

@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

🤖 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 `@test/e2e/test-sessions-agents-cli.sh`:
- Around line 275-290: The loop in test_sessions_reset_main enables errexit
unintentionally by using set +e ... set -e around the command substitution;
remove both set +e and set -e so capturing out="$(nemoclaw ...)" and
exit_code=$? works without changing global errexit state (alternatively
save/restore errexit, but simplest fix is to drop the toggles around the
nemoclaw call in the while loop).
🪄 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: b71e181a-b38b-4393-ab1d-016f798479c6

📥 Commits

Reviewing files that changed from the base of the PR and between 26d43bb and d3f4119.

📒 Files selected for processing (1)
  • test/e2e/test-sessions-agents-cli.sh

Comment thread test/e2e/test-sessions-agents-cli.sh
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ❌ Some jobs failed

Run: 26812181955
Target ref: feat-sessions-cli-group
Requested jobs: sessions-agents-cli-e2e
Summary: 0 passed, 1 failed, 0 skipped

Job Result
sessions-agents-cli-e2e ❌ failure

Failed jobs: sessions-agents-cli-e2e. Check run artifacts for logs.

@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

🤖 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/actions/sandbox/sessions/gateway-rpc-envelope.ts`:
- Around line 85-107: The current logic only attempts one slice from the first
"{" to the last "}", which can merge multiple pretty-printed JSON blocks and
make JSON.parse fail; update the block extraction to enumerate all candidate
blocks instead: collect every index where lines[i].trim() === "{" and for each
start index, search forward for each subsequent index where lines[j].trim() ===
"}" and attempt JSON.parse(lines.slice(start, j+1).join("\n")), then pass the
parsed object to normalisePayload and return the first truthy
GatewayCallEnvelope<T> result; replace the single blockStart/blockEnd approach
(using variables trimmed, lines, normalisePayload, GatewayCallEnvelope) with
this exhaustive start/end pairing and early-return on the first valid parse.
🪄 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: 9c71299a-d698-4f2d-b905-1be364ede15b

📥 Commits

Reviewing files that changed from the base of the PR and between d3f4119 and 5766b47.

📒 Files selected for processing (3)
  • src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc.test.ts
  • test/e2e/test-sessions-agents-cli.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/test-sessions-agents-cli.sh

Comment thread src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts Outdated
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26813211715
Target ref: feat-sessions-cli-group
Requested jobs: sessions-agents-cli-e2e
Summary: 1 passed, 0 failed, 0 skipped

Job Result
sessions-agents-cli-e2e ✅ success

…yload

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26814058813
Target ref: feat-sessions-cli-group
Requested jobs: sessions-agents-cli-e2e
Summary: 1 passed, 0 failed, 0 skipped

Job Result
sessions-agents-cli-e2e ✅ success

@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

🤖 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/actions/sandbox/sessions/delete.test.ts`:
- Around line 113-117: The test title misstates the
payload—gatewayMock.mockReturnValue returns { ok: true, removedTranscript: true
} which triggers the typeof payload.key !== "string" branch, not the ok !== true
branch; update the it(...) description string in this test (the "rejects an
unexpected payload..." test) to accurately reflect the case (e.g., "rejects an
unexpected payload (missing key) and exits non-zero" or "rejects when
payload.key is missing/not a string") so the test name matches the payload used
by gatewayMock.mockReturnValue.
🪄 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: 9c3ab3cd-1d9c-4518-bf94-93708ea5eb1b

📥 Commits

Reviewing files that changed from the base of the PR and between d3f4119 and 36a9a0d.

📒 Files selected for processing (8)
  • src/lib/actions/sandbox/sessions/delete.test.ts
  • src/lib/actions/sandbox/sessions/delete.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc-envelope.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc.test.ts
  • src/lib/actions/sandbox/sessions/gateway-rpc.ts
  • src/lib/actions/sandbox/sessions/reset.test.ts
  • src/lib/actions/sandbox/sessions/reset.ts
  • test/e2e/test-sessions-agents-cli.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/lib/actions/sandbox/sessions/reset.test.ts
  • test/e2e/test-sessions-agents-cli.sh

Comment thread src/lib/actions/sandbox/sessions/delete.test.ts Outdated
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@laitingsheng laitingsheng added the v0.0.57 Release target label Jun 2, 2026

@prekshivyas prekshivyas 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.

APPROVE. Reviewed the full command/action/test surface.

Security: clean. execSandbox is spawnSync(binary, argv[]) with no shell, so passthrough args can't inject; reset/delete additionally validate keys against shell metacharacters and guard the agent: canonical prefix (paths.ts:1375-1426). Output exposes only gateway session keys/entries — no secrets. Authz is delegated to the in-sandbox gateway; the host never touches sessions.json, and enumeration is scoped per-agent.

Tests/docs: per-subcommand unit coverage is solid (happy path, --agent mismatch refusal, gateway error + unexpected-payload, --json, --keep-transcript, alias→canonical) with mocks only at the gateway/sandbox boundary; the e2e asserts real post-conditions (key/agent actually gone), not just exit codes. All six commands are documented in commands.mdx with flag tables; SPDX headers present. CI green on 2de6506, all 4 CodeRabbit threads resolved. Closes #834 (and exceeds it — reset + delete/list + agents group).

Non-blocking nits: (1) --verbose only gates entry output in non-JSON mode; in --json mode entry is always emitted (delete.ts:962, reset.ts:1736) — harmless inconsistency; (2) runAgentsPassthrough/runSessionsPassthrough argv builders have no dedicated unit test — covered transitively by e2e + translation tests, but a small direct argv assertion would close the loop.

Signed-off-by: Prekshi Vyas prekshiv@nvidia.com

@prekshivyas prekshivyas self-assigned this Jun 2, 2026
@cv cv merged commit 02af05b into main Jun 2, 2026
32 checks passed
@cv cv deleted the feat-sessions-cli-group branch June 2, 2026 18:27
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: e2e End-to-end tests, nightly failures, or validation infrastructure feature PR adds or expands user-visible functionality and removed NemoClaw CLI labels Jun 3, 2026
cv pushed a commit that referenced this pull request Jun 3, 2026
## Summary
- Add the missing `v0.0.57` release-notes section with links to the
detailed docs pages for command, inference, onboarding, messaging,
status, installer, and policy changes.
- Remove public references to docs-skip terms from source docs and
regenerate the NemoClaw user skills from the current Fern MDX docs.
- Carry forward generated references for the per-agent documentation
split, including Hermes-specific reference files.

## Source summary
- #4615 and #4653 -> `docs/about/release-notes.mdx`,
`docs/reference/commands.mdx`: Release notes now cover host-side
`sessions` and `agents` commands plus `NEMOCLAW_EXTRA_AGENTS_JSON`
secondary-agent baking.
- #4163, #4204, #4611, #4619, and #4676 ->
`docs/about/release-notes.mdx`,
`docs/inference/use-local-inference.mdx`: Release notes now cover
managed vLLM progress/readiness, DGX Spark model default changes, local
Ollama streaming usage, and inference route divergence warnings.
- #4267, #4601, #4609, #4642, #4645, and #4661 ->
`docs/about/release-notes.mdx`, `docs/reference/commands.mdx`: Release
notes now cover UFW auto-remediation, local-inference reachability
gates, gateway reuse/binding, cancel rollback, and policy selection
persistence.
- #4577, #4582, #4607, and #4660 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/messaging-channels.mdx`: Release notes now cover
Slack validation, atomic `channels add`, WhatsApp QR diagnostics, and
Slack placeholder normalization.
- #4388, #4600, #4646, and #4647 -> `docs/about/release-notes.mdx`,
`docs/reference/commands.mdx`: Release notes now cover status failure
layers, paused-container hints, Docker-driver doctor behavior, and
non-destructive stale-registry recovery.
- #4569, #4579, and #4678 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/lifecycle.mdx`,
`docs/network-policy/integration-policy-examples.mdx`: Release notes now
cover installer tag pinning, PyPI `uv` policy access, and observable
Jira validation.
- #4632 -> `.agents/skills/`: Regenerated user skills from the current
per-agent docs source, including newly generated Hermes reference files.

## Verification
- `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix
nemoclaw-user --doc-platform fern-mdx`
- `rg "permissive mode|shields down|shields up|shields status|config
rotate-token|rotate-token" docs --glob "*.mdx"`
- `rg "permissive mode|shields down|shields up|shields status|config
rotate-token|rotate-token" .agents/skills --glob "*.md"`
- `npm run docs`
- `npm run build:cli`
- Commit hooks: markdownlint, docs-to-skills verification, gitleaks,
skills YAML, commitlint

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Restructured documentation to clearly distinguish OpenClaw and Hermes
agent variants throughout user guides.
* Enhanced security, credential storage, and deployment guidance with
clearer setup flows.
  * Added Hermes plugin installation and ecosystem documentation.
* Improved workspace, messaging, and policy management references with
variant-specific command examples.
  * Refined troubleshooting and CLI reference sections for clarity.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
cv pushed a commit that referenced this pull request Jun 9, 2026
## Summary
Adds `nemoclaw <name> agents list` as a thin pass-through to `openclaw
agents list` via `openshell sandbox exec`. This finishes the host-side
agent lifecycle surface — `add` and `delete` shipped in #4615;
declarative seeding is already covered by the bake-time
`NEMOCLAW_EXTRA_AGENTS_JSON` path from #4560.

## Related Issue
Closes #2854.

## Changes
- `src/commands/sandbox/agents/list.ts`: new oclif command, mirrors the
`sessions list` and `agents add`/`delete` shape.
- `src/lib/actions/sandbox/agents/passthrough.ts`:
`AgentsPassthroughVerb` extended to `"add" | "delete" | "list"`; parent
help now lists the third subcommand.
- `src/commands/sandbox/agents.ts`: parent examples include `agents list
alpha --json`.
- `src/lib/cli/public-display-agents.ts`: registers
`sandbox:agents:list` under Sandbox Management at order 16.4 (ahead of
add/delete to match lifecycle order).
- `src/lib/cli/command-registry.test.ts`: bumps sandbox-command count 43
-> 44 and updates the comment from "agents pair" to "agents trio".
- `docs/reference/commands.mdx`: new `### nemoclaw <name> agents list`
section before the existing `add` entry.
- `test/e2e/test-sessions-agents-cli.sh`: new `TC-AGENT-03` between add
and delete; calls `agents list --json` and asserts the seeded agent
appears in the listing.

## Out of Scope
`agents apply -f` from the original design is dropped — per-entry
`agents add` (shipped via #4615) already covers operator workflows, and
`NEMOCLAW_EXTRA_AGENTS_JSON` (shipped via #4560) already handles
declarative bake-time seeding. No upstream `openclaw agents apply` verb
or `agents.apply` gateway RPC exists, so a host-side reconcile would
also need a new `agents update` CLI verb upstream first.

## Type of Change

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

## Verification
- [x] `npx prek run --all-files` passes
- [x] `npm test` passes
- [x] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [x] Docs updated for user-facing behavior changes
- [ ] `npm run docs` builds without warnings (doc changes only)
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a sandbox agents list command to list OpenClaw agents configured
in a sandbox, supporting passthrough flags (including --json and
--bindings).

* **Documentation**
* Updated command reference and help text; added docs for the agents
list passthrough in both nemoclaw and nemohermes command sections.

* **Tests**
* Added end-to-end test coverage validating the agents list output (JSON
and presence of added agent).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
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 area: e2e End-to-end tests, nightly failures, or validation infrastructure feature PR adds or expands user-visible functionality integration: openclaw OpenClaw integration behavior v0.0.57 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add openclaw sessions reset <session-id> subcommand

4 participants