Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/lib/agent-onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ export function createAgentSandbox(agent: AgentDefinition): {

if (baseDockerfile) {
const baseImageTag = `ghcr.io/nvidia/nemoclaw/${agent.name}-sandbox-base:latest`;
const inspectResult = run(`docker image inspect ${shellQuote(baseImageTag)} >/dev/null 2>&1`, {
const inspectResult = run(["docker", "image", "inspect", baseImageTag], {
ignoreError: true,
stdio: ["ignore", "ignore", "ignore"],
});
if (inspectResult.status !== 0) {
console.log(` Building ${agent.displayName} base image (first time only)...`);
run(
`docker build -f ${shellQuote(baseDockerfile)} -t ${shellQuote(baseImageTag)} ${shellQuote(ROOT)}`,
["docker", "build", "-f", baseDockerfile, "-t", baseImageTag, ROOT],
{ stdio: ["ignore", "inherit", "inherit"] },
);
console.log(` \u2713 Base image built: ${baseImageTag}`);
Expand Down Expand Up @@ -156,6 +157,10 @@ export async function handleAgentSetup(
const script = buildSandboxConfigSyncScript(sandboxConfig);
const scriptFile = writeSandboxConfigSyncFile(script);
try {
// NOTE: This call retains the shell string form because it requires stdin
// redirection (< scriptFile) which cannot be expressed as a pure argv array
// without access to the openshell binary path. A full migration requires
// exposing getOpenshellBinary() or runOpenshell() in the OnboardContext.
run(
`${openshellShellCommand(["sandbox", "connect", sandboxName])} < ${shellQuote(scriptFile)}`,
{ stdio: ["ignore", "ignore", "inherit"] },
Expand Down