fix: surface sandbox create progress diagnostics

Persist sandbox creation lifecycle events to the activity log, surface progress in the dashboard, and expose controller gateway override diagnostics.
This commit is contained in:
mmckeen-nv
2026-06-03 09:14:54 -06:00
committed by GitHub
parent c57ecb1131
commit c500998567
6 changed files with 126 additions and 23 deletions
+6 -1
View File
@@ -12,10 +12,11 @@ const terminalReadinessPath = path.join(root, 'app/api/openshell/terminal/readin
const telemetryPath = path.join(root, 'app/api/telemetry/real/route.ts')
const openshellHostPath = path.join(root, 'app/lib/openshellHost.ts')
const sandboxHealthPath = path.join(root, 'app/api/sandbox/[sandboxId]/health/route.ts')
const openshellConfigPath = path.join(root, 'app/api/config/openshell/route.ts')
const packageJsonPath = path.join(root, 'package.json')
const serverPath = path.join(root, 'server.mjs')
const [runtimeAuthoritySource, dashboardOpenSource, dashboardProxySource, terminalLiveSource, terminalReadinessSource, telemetrySource, openshellHostSource, sandboxHealthSource, packageJsonSource, serverSource] = await Promise.all([
const [runtimeAuthoritySource, dashboardOpenSource, dashboardProxySource, terminalLiveSource, terminalReadinessSource, telemetrySource, openshellHostSource, sandboxHealthSource, openshellConfigSource, packageJsonSource, serverSource] = await Promise.all([
readFile(runtimeAuthorityPath, 'utf8'),
readFile(dashboardOpenPath, 'utf8'),
readFile(dashboardProxySharedPath, 'utf8'),
@@ -24,6 +25,7 @@ const [runtimeAuthoritySource, dashboardOpenSource, dashboardProxySource, termin
readFile(telemetryPath, 'utf8'),
readFile(openshellHostPath, 'utf8'),
readFile(sandboxHealthPath, 'utf8'),
readFile(openshellConfigPath, 'utf8'),
readFile(packageJsonPath, 'utf8'),
readFile(serverPath, 'utf8'),
])
@@ -60,6 +62,9 @@ assert.match(openshellHostSource, /const canMintBootstrapFromCli = instance\.id
assert.match(openshellHostSource, /readSandboxOpenClawDashboardToken/, 'sandbox dashboard bootstrap must fall back to the sandbox OpenClaw token when CLI output is bare')
assert.match(openshellHostSource, /openclaw dashboard', 15000\)\.catch/, 'sandbox dashboard bootstrap should let OpenClaw initialize before reading the fallback token')
assert.match(openshellHostSource, /withDashboardToken\(tokenizedBootstrapUrl, token\)/, 'sandbox dashboard bootstrap should synthesize a tokenized launch URL from the fallback token')
assert.match(openshellConfigSource, /openshellGatewayAddressEnv/, 'OpenShell config route must expose controller gateway override diagnostics')
assert.match(openshellConfigSource, /gatewayOverrideActive/, 'OpenShell config route must report whether gateway overrides are active')
assert.match(openshellConfigSource, /Upstream CLIs must still honor them/, 'OpenShell config route must make the upstream dependency explicit')
assert.match(packageJsonSource, /"dev": "NODE_ENV=development node server\.mjs"/, 'development script must run through the custom server so websocket proxy bridges are active')
assert.match(packageJsonSource, /"start": "NODE_ENV=production node server\.mjs"/, 'production start must run the custom server without Next dev-mode heap growth')
assert.match(serverSource, /const dashboardWsProxyPort = parseOptionalPort\(process\.env\.OPENCLAW_DASHBOARD_WS_PROXY_PORT/, 'custom server must make the dedicated dashboard websocket sidecar opt-in')
+12
View File
@@ -24,6 +24,7 @@ const versionedInstallerPath = path.join(root, 'install_versioned_nemoclaw_opens
const hookPath = path.join(root, 'app/hooks/useSandboxInventory.ts')
const pagePath = path.join(root, 'app/page.tsx')
const configPanelPath = path.join(root, 'app/components/ConfigurationPanel.tsx')
const activityPanelPath = path.join(root, 'app/components/ActivityPanel.tsx')
const inferencePanelPath = path.join(root, 'app/components/InferenceEndpointPanel.tsx')
const sandboxInferencePanelPath = path.join(root, 'app/components/SandboxInferencePanel.tsx')
const sidebarPath = path.join(root, 'app/components/Sidebar.tsx')
@@ -52,6 +53,7 @@ const versionedInstallerSource = await readFile(versionedInstallerPath, 'utf8')
const hookSource = await readFile(hookPath, 'utf8')
const pageSource = await readFile(pagePath, 'utf8')
const configPanelSource = await readFile(configPanelPath, 'utf8')
const activityPanelSource = await readFile(activityPanelPath, 'utf8')
const inferencePanelSource = await readFile(inferencePanelPath, 'utf8')
const sandboxInferencePanelSource = await readFile(sandboxInferencePanelPath, 'utf8')
const sidebarSource = await readFile(sidebarPath, 'utf8')
@@ -69,6 +71,16 @@ assert.match(
/readiness:\s*\{\s*attempts: readiness\.attempts,\s*elapsedMs: readiness\.elapsedMs,/,
'blueprint create response must expose readiness polling metadata',
)
assert.match(createRouteSource, /recordActivity/, 'sandbox create route must persist create progress to the activity log')
assert.match(createRouteSource, /async function recordCreateActivity/, 'sandbox create activity logging must be isolated behind a best-effort helper')
assert.match(createRouteSource, /activity-log:error/, 'sandbox create activity logging failures must be reported without failing creation')
assert.match(createRouteSource, /sandbox\.create\.start/, 'sandbox create route must record a durable start event before long-running work')
assert.match(createRouteSource, /sandbox\.create\.success/, 'sandbox create route must record a durable success event')
assert.match(createRouteSource, /sandbox\.create\.error/, 'sandbox create route must record durable failure events')
assert.ok(createRouteSource.indexOf('if (!blueprint)') < createRouteSource.indexOf('sandbox.create.start'), 'sandbox create route must validate required blueprint before recording a start event')
assert.match(createRouteSource, /sandbox\.create\.error[\s\S]*unknown blueprint/, 'unknown blueprint must be paired with a durable error event after a start event')
assert.match(pageSource, /<ActivityPanel \/>/, 'dashboard must surface the activity log so create progress remains visible after navigation')
assert.match(activityPanelSource, /sandbox creation/, 'activity panel copy must include sandbox creation progress events')
assert.match(createRouteSource, /"onboard",[\s\S]*"--non-interactive",[\s\S]*"--recreate-sandbox"/, 'blueprint create must use the Monday-era normal NemoClaw onboard flow')
assert.match(createRouteSource, /type NemoClawAgent = "openclaw" \| "hermes"/, 'blueprint create must model OpenClaw and Hermes NemoClaw agents')
assert.match(createRouteSource, /function nemoClawAgentForBlueprint\(blueprint: string\): NemoClawAgent/, 'blueprint create must map dashboard blueprints to NemoClaw agents')