feat(onboard): bake secondary agents via NEMOCLAW_EXTRA_AGENTS_JSON - #4670
feat(onboard): bake secondary agents via NEMOCLAW_EXTRA_AGENTS_JSON#4670sandl99 wants to merge 5 commits into
Conversation
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com> # Conflicts: # docs/reference/commands.mdx
…uild Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
… agents Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR enables operators to define secondary OpenClaw agents via the ChangesExtra OpenClaw agents feature
Sequence DiagramsequenceDiagram
participant Operator
participant NemoClaw as NemoClaw onboard
participant patchStagedDockerfile
participant Dockerfile
participant generateOpenclawConfig as generate-openclaw-config.mts
participant OpencloConf as openclaw.json
Operator->>NemoClaw: NEMOCLAW_EXTRA_AGENTS_JSON env var
NemoClaw->>patchStagedDockerfile: staged Dockerfile + env var
patchStagedDockerfile->>Dockerfile: patch ARG NEMOCLAW_EXTRA_AGENTS_JSON_B64
Dockerfile->>Dockerfile: docker build (passes base64 ARG)
Dockerfile->>generateOpenclawConfig: NEMOCLAW_EXTRA_AGENTS_JSON_B64 env var
generateOpenclawConfig->>generateOpenclawConfig: decode, validate, normalize
generateOpenclawConfig->>generateOpenclawConfig: buildAgentsList (main + extras)
generateOpenclawConfig->>OpencloConf: agents.list with main+extras
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pr-4670.docs.buildwithfern.com/nemoclaw |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: Dispatch required scenario E2E:
Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 4 worth checking, 1 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
This is an automated advisory review. A human maintainer must make the final merge decision. |
Summary
Replaces #4653 with the same diff on a fresh upstream branch so E2E can be dispatched against the replacement PR. Adds
NEMOCLAW_EXTRA_AGENTS_JSONso operators can bake one or more OpenClaw secondary agents into the sandboxopenclaw.jsonat onboard time, while keeping the canonicalmainagent first and default.Related Issue
Closes #4560.
Closes #4562 — complementary to #4560.
Changes
scripts/generate-openclaw-config.mts: validateNEMOCLAW_EXTRA_AGENTS_JSON_B64— id regex, reserved-idmainrejection, duplicate-id rejection,resolve()-based containment under/sandbox/.openclaw/, required per-agenttoolsallow/deny policy, requiredsubagents.maxSpawnDepth, nodefault: trueoverrides, and canonicalagents.listemission withmainfirst.src/lib/onboard/dockerfile-patch.ts: readNEMOCLAW_EXTRA_AGENTS_JSONand base64-encode the raw payload intoARG NEMOCLAW_EXTRA_AGENTS_JSON_B64so build-time validation remains the single structured validation path.Dockerfile: declare and promoteNEMOCLAW_EXTRA_AGENTS_JSON_B64using the existingNEMOCLAW_*_B64convention.test/generate-openclaw-config.test.tsandsrc/lib/onboard/dockerfile-patch-extra-agents.test.ts: add coverage for default-only emission, valid extras, reserved IDs, duplicate IDs, path traversal, required fields, field allowlists, and malformed host payload passthrough.docs/reference/commands.mdx: document the extra-agent schema, constraints, validation rules, and example payload.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Note: local checks were not rerun for this replacement branch; it copies #4653 unchanged. The original #4653 PR checks were green, and this PR is intended to enable the trusted E2E rerun path.
Signed-off-by: San Dang sdang@nvidia.com
Summary by CodeRabbit
New Features
Documentation
Tests