Launch per-sandbox OpenClaw dashboards
This commit is contained in:
@@ -79,7 +79,7 @@ export async function GET(request: Request) {
|
|||||||
? 'bridged'
|
? 'bridged'
|
||||||
: 'verified'
|
: 'verified'
|
||||||
|
|
||||||
const proxiedUrl = authority.explicitInstanceOverride ? instanceQualifiedProxyBase : '/api/openshell/dashboard/proxy'
|
const proxiedUrl = authority.bridgeActive ? instanceQualifiedProxyBase : '/api/openshell/dashboard/proxy'
|
||||||
const launchUrl = buildLaunchUrl(request, requestUrl, proxiedUrl, probe.bootstrapUrl)
|
const launchUrl = buildLaunchUrl(request, requestUrl, proxiedUrl, probe.bootstrapUrl)
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ export default function SandboxList({
|
|||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
const searchParams = new URLSearchParams()
|
const searchParams = new URLSearchParams()
|
||||||
searchParams.set('sandboxId', selectedSandbox.id)
|
searchParams.set('sandboxId', selectedSandbox.name)
|
||||||
searchParams.set('inventoryCount', String(sandboxes.length))
|
searchParams.set('inventoryCount', String(sandboxes.length))
|
||||||
const res = await fetch(`/api/openshell/dashboard/open?${searchParams.toString()}`)
|
const res = await fetch(`/api/openshell/dashboard/open?${searchParams.toString()}`)
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ export type OpenClawInstanceRecord = {
|
|||||||
const DEFAULT_OPENCLAW_DASHBOARD_URL = 'http://127.0.0.1:18789/'
|
const DEFAULT_OPENCLAW_DASHBOARD_URL = 'http://127.0.0.1:18789/'
|
||||||
const DEFAULT_TERMINAL_SERVER_URL = process.env.TERMINAL_SERVER_URL || 'http://127.0.0.1:3011'
|
const DEFAULT_TERMINAL_SERVER_URL = process.env.TERMINAL_SERVER_URL || 'http://127.0.0.1:3011'
|
||||||
const DEFAULT_INSTANCE_ID = 'default'
|
const DEFAULT_INSTANCE_ID = 'default'
|
||||||
|
const SANDBOX_INSTANCE_PREFIX = 'sandbox'
|
||||||
|
const SANDBOX_DASHBOARD_PORT_BASE = Number.parseInt(process.env.OPENCLAW_SANDBOX_DASHBOARD_PORT_BASE || '19000', 10)
|
||||||
|
const SANDBOX_DASHBOARD_PORT_RANGE = 2000
|
||||||
|
|
||||||
const DEFAULT_INSTANCE: OpenClawInstanceRecord = {
|
const DEFAULT_INSTANCE: OpenClawInstanceRecord = {
|
||||||
id: DEFAULT_INSTANCE_ID,
|
id: DEFAULT_INSTANCE_ID,
|
||||||
@@ -72,9 +75,9 @@ function parseRegistryFromEnv(): OpenClawInstanceRecord[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const OPENCLAW_INSTANCE_REGISTRY = parseRegistryFromEnv()
|
const OPENCLAW_INSTANCE_REGISTRY = parseRegistryFromEnv()
|
||||||
const DEFAULT_SANDBOX_INSTANCE_MAP = process.env.MY_ASSISTANT_OPENCLAW_INSTANCE_ID?.trim()
|
const DEFAULT_SANDBOX_INSTANCE_MAP: Record<string, string> = process.env.MY_ASSISTANT_OPENCLAW_INSTANCE_ID?.trim()
|
||||||
? { 'my-assistant': process.env.MY_ASSISTANT_OPENCLAW_INSTANCE_ID.trim() }
|
? { 'my-assistant': process.env.MY_ASSISTANT_OPENCLAW_INSTANCE_ID.trim() }
|
||||||
: { 'my-assistant': DEFAULT_INSTANCE_ID }
|
: {}
|
||||||
|
|
||||||
function parseSandboxInstanceMapFromEnv(): Record<string, string> {
|
function parseSandboxInstanceMapFromEnv(): Record<string, string> {
|
||||||
const raw = process.env.OPENCLAW_SANDBOX_INSTANCE_MAP_JSON?.trim()
|
const raw = process.env.OPENCLAW_SANDBOX_INSTANCE_MAP_JSON?.trim()
|
||||||
@@ -105,6 +108,54 @@ function parseSandboxInstanceMapFromEnv(): Record<string, string> {
|
|||||||
|
|
||||||
const OPENCLAW_SANDBOX_INSTANCE_MAP = parseSandboxInstanceMapFromEnv()
|
const OPENCLAW_SANDBOX_INSTANCE_MAP = parseSandboxInstanceMapFromEnv()
|
||||||
|
|
||||||
|
function normalizeSandboxId(value?: string | null) {
|
||||||
|
if (typeof value !== 'string') return ''
|
||||||
|
return value.trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
function hashSandboxId(value: string) {
|
||||||
|
let hash = 0
|
||||||
|
for (let index = 0; index < value.length; index += 1) {
|
||||||
|
hash = ((hash << 5) - hash + value.charCodeAt(index)) | 0
|
||||||
|
}
|
||||||
|
return Math.abs(hash)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getOpenClawDashboardPortForSandbox(sandboxId?: string | null) {
|
||||||
|
const normalized = normalizeSandboxId(sandboxId)
|
||||||
|
if (!normalized) return null
|
||||||
|
return SANDBOX_DASHBOARD_PORT_BASE + (hashSandboxId(normalized) % SANDBOX_DASHBOARD_PORT_RANGE)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function buildSandboxOpenClawInstanceId(sandboxId?: string | null) {
|
||||||
|
const normalized = normalizeSandboxId(sandboxId)
|
||||||
|
const port = getOpenClawDashboardPortForSandbox(normalized)
|
||||||
|
if (!normalized || !port) return null
|
||||||
|
return `${SANDBOX_INSTANCE_PREFIX}-${port}-${normalized}`
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseSandboxOpenClawInstanceId(instanceId: string) {
|
||||||
|
const match = instanceId.match(/^sandbox-(\d+)-(.+)$/)
|
||||||
|
if (!match) return null
|
||||||
|
const port = Number.parseInt(match[1], 10)
|
||||||
|
const sandboxId = match[2]
|
||||||
|
if (!Number.isFinite(port) || !sandboxId) return null
|
||||||
|
return { port, sandboxId }
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveSandboxOpenClawInstance(instanceId: string): OpenClawInstanceRecord | null {
|
||||||
|
const parsed = parseSandboxOpenClawInstanceId(instanceId)
|
||||||
|
if (!parsed) return null
|
||||||
|
return {
|
||||||
|
id: instanceId,
|
||||||
|
label: `OpenClaw for ${parsed.sandboxId}`,
|
||||||
|
dashboardUrl: `http://127.0.0.1:${parsed.port}/`,
|
||||||
|
terminalServerUrl: DEFAULT_TERMINAL_SERVER_URL,
|
||||||
|
loopbackOnly: true,
|
||||||
|
default: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function listOpenClawInstances() {
|
export function listOpenClawInstances() {
|
||||||
return OPENCLAW_INSTANCE_REGISTRY.map((entry) => ({ ...entry }))
|
return OPENCLAW_INSTANCE_REGISTRY.map((entry) => ({ ...entry }))
|
||||||
}
|
}
|
||||||
@@ -116,13 +167,15 @@ export function getDefaultOpenClawInstance() {
|
|||||||
export function resolveOpenClawInstance(instanceId?: string | null) {
|
export function resolveOpenClawInstance(instanceId?: string | null) {
|
||||||
const requested = typeof instanceId === 'string' ? instanceId.trim() : ''
|
const requested = typeof instanceId === 'string' ? instanceId.trim() : ''
|
||||||
if (!requested) return getDefaultOpenClawInstance()
|
if (!requested) return getDefaultOpenClawInstance()
|
||||||
|
const sandboxInstance = resolveSandboxOpenClawInstance(requested)
|
||||||
|
if (sandboxInstance) return sandboxInstance
|
||||||
return OPENCLAW_INSTANCE_REGISTRY.find((entry) => entry.id === requested) || getDefaultOpenClawInstance()
|
return OPENCLAW_INSTANCE_REGISTRY.find((entry) => entry.id === requested) || getDefaultOpenClawInstance()
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getOpenClawInstanceIdForSandbox(sandboxId?: string | null) {
|
export function getOpenClawInstanceIdForSandbox(sandboxId?: string | null) {
|
||||||
const requestedSandboxId = typeof sandboxId === 'string' ? sandboxId.trim() : ''
|
const requestedSandboxId = normalizeSandboxId(sandboxId)
|
||||||
if (!requestedSandboxId) return null
|
if (!requestedSandboxId) return null
|
||||||
return OPENCLAW_SANDBOX_INSTANCE_MAP[requestedSandboxId] || null
|
return OPENCLAW_SANDBOX_INSTANCE_MAP[requestedSandboxId] || buildSandboxOpenClawInstanceId(requestedSandboxId)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resolveOpenClawInstanceForSandbox(sandboxId?: string | null) {
|
export function resolveOpenClawInstanceForSandbox(sandboxId?: string | null) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { execFile, spawn } from "node:child_process"
|
import { execFile, spawn } from "node:child_process"
|
||||||
import { existsSync } from "node:fs"
|
import { existsSync } from "node:fs"
|
||||||
import { promisify } from "node:util"
|
import { promisify } from "node:util"
|
||||||
import { getDefaultOpenClawInstance, resolveOpenClawInstance } from "./openclawInstances"
|
import { getDefaultOpenClawInstance, getOpenClawDashboardPortForSandbox, resolveOpenClawInstance } from "./openclawInstances"
|
||||||
|
|
||||||
const execFileAsync = promisify(execFile)
|
const execFileAsync = promisify(execFile)
|
||||||
|
|
||||||
@@ -30,6 +30,7 @@ const OPENCLAW_BIN =
|
|||||||
OPENCLAW_BIN_CANDIDATES.find((candidate) => existsSync(candidate)) ?? OPENCLAW_BIN_CANDIDATES[0] ?? "openclaw"
|
OPENCLAW_BIN_CANDIDATES.find((candidate) => existsSync(candidate)) ?? OPENCLAW_BIN_CANDIDATES[0] ?? "openclaw"
|
||||||
const OPENSHELL_GATEWAY = process.env.OPENSHELL_GATEWAY || "openshell"
|
const OPENSHELL_GATEWAY = process.env.OPENSHELL_GATEWAY || "openshell"
|
||||||
const OPENSHELL_NAMESPACE = "agent-sandbox-system"
|
const OPENSHELL_NAMESPACE = "agent-sandbox-system"
|
||||||
|
const SANDBOX_DASHBOARD_REMOTE_PORT = Number.parseInt(process.env.OPENCLAW_SANDBOX_DASHBOARD_REMOTE_PORT || "18789", 10)
|
||||||
|
|
||||||
export type HostTelemetry = {
|
export type HostTelemetry = {
|
||||||
cpu: number
|
cpu: number
|
||||||
@@ -324,6 +325,8 @@ export async function resolveOpenClawDashboardBootstrap(instanceId?: string | nu
|
|||||||
async function ensureOpenClawDashboardListener(instanceId: string, port: number) {
|
async function ensureOpenClawDashboardListener(instanceId: string, port: number) {
|
||||||
const instance = resolveOpenClawInstance(instanceId)
|
const instance = resolveOpenClawInstance(instanceId)
|
||||||
const defaultInstance = getDefaultOpenClawInstance()
|
const defaultInstance = getDefaultOpenClawInstance()
|
||||||
|
const sandboxInstance = resolveSandboxInstanceId(instance.id)
|
||||||
|
if (sandboxInstance) return ensureSandboxOpenClawDashboardTunnel(sandboxInstance.sandboxId)
|
||||||
if (instance.id !== defaultInstance.id) return inspectListeningPort(port)
|
if (instance.id !== defaultInstance.id) return inspectListeningPort(port)
|
||||||
|
|
||||||
const initial = await inspectListeningPort(port)
|
const initial = await inspectListeningPort(port)
|
||||||
@@ -339,6 +342,79 @@ async function ensureOpenClawDashboardListener(instanceId: string, port: number)
|
|||||||
return waitForListeningPort(port)
|
return waitForListeningPort(port)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resolveSandboxInstanceId(instanceId: string) {
|
||||||
|
const match = instanceId.match(/^sandbox-(\d+)-(.+)$/)
|
||||||
|
if (!match) return null
|
||||||
|
const port = Number.parseInt(match[1], 10)
|
||||||
|
const sandboxId = match[2]
|
||||||
|
if (!Number.isFinite(port) || !sandboxId) return null
|
||||||
|
return { port, sandboxId }
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildSandboxSshArgs(sandboxName: string, extraArgs: string[]) {
|
||||||
|
return [
|
||||||
|
"-o", "BatchMode=yes",
|
||||||
|
"-o", "StrictHostKeyChecking=no",
|
||||||
|
"-o", "UserKnownHostsFile=/dev/null",
|
||||||
|
"-o", "GlobalKnownHostsFile=/dev/null",
|
||||||
|
"-o", "LogLevel=ERROR",
|
||||||
|
"-o", `ProxyCommand=${OPENSHELL_BIN} ssh-proxy --gateway-name nemoclaw --name ${sandboxName}`,
|
||||||
|
`sandbox@openshell-${sandboxName}`,
|
||||||
|
...extraArgs,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
async function execSandboxSsh(sandboxName: string, command: string, timeoutMs = 10000) {
|
||||||
|
return execFileAsync("ssh", buildSandboxSshArgs(sandboxName, [command]), {
|
||||||
|
timeout: timeoutMs,
|
||||||
|
maxBuffer: 2 * 1024 * 1024,
|
||||||
|
env: buildOpenClawEnv(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function ensureRemoteSandboxOpenClawDashboard(sandboxName: string) {
|
||||||
|
const command = [
|
||||||
|
`curl -fsS --max-time 2 http://127.0.0.1:${SANDBOX_DASHBOARD_REMOTE_PORT}/ >/dev/null 2>&1`,
|
||||||
|
"||",
|
||||||
|
`(nohup /usr/local/bin/openclaw gateway run --allow-unconfigured --bind loopback --port ${SANDBOX_DASHBOARD_REMOTE_PORT} >/tmp/gateway.log 2>&1 &)`
|
||||||
|
].join(" ")
|
||||||
|
|
||||||
|
await execSandboxSsh(sandboxName, command).catch(() => null)
|
||||||
|
|
||||||
|
for (let attempt = 0; attempt < 16; attempt += 1) {
|
||||||
|
try {
|
||||||
|
await execSandboxSsh(sandboxName, `curl -fsS --max-time 2 http://127.0.0.1:${SANDBOX_DASHBOARD_REMOTE_PORT}/ >/dev/null`, 5000)
|
||||||
|
return true
|
||||||
|
} catch {
|
||||||
|
await sleep(500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
async function ensureSandboxOpenClawDashboardTunnel(sandboxName: string) {
|
||||||
|
const port = getOpenClawDashboardPortForSandbox(sandboxName)
|
||||||
|
if (!port) return inspectListeningPort(SANDBOX_DASHBOARD_REMOTE_PORT)
|
||||||
|
|
||||||
|
const initial = await inspectListeningPort(port)
|
||||||
|
if (initial.listenerPresent) return initial
|
||||||
|
|
||||||
|
await ensureRemoteSandboxOpenClawDashboard(sandboxName)
|
||||||
|
|
||||||
|
const child = spawn("ssh", buildSandboxSshArgs(sandboxName, [
|
||||||
|
"-N",
|
||||||
|
"-L", `127.0.0.1:${port}:127.0.0.1:${SANDBOX_DASHBOARD_REMOTE_PORT}`,
|
||||||
|
]), {
|
||||||
|
detached: true,
|
||||||
|
env: buildOpenClawEnv(),
|
||||||
|
stdio: "ignore",
|
||||||
|
})
|
||||||
|
child.unref()
|
||||||
|
|
||||||
|
return waitForListeningPort(port, 8000)
|
||||||
|
}
|
||||||
|
|
||||||
export async function probeOpenClawDashboard(instanceId?: string | null): Promise<DashboardProbe> {
|
export async function probeOpenClawDashboard(instanceId?: string | null): Promise<DashboardProbe> {
|
||||||
const instance = resolveOpenClawInstance(instanceId)
|
const instance = resolveOpenClawInstance(instanceId)
|
||||||
const target = new URL(instance.dashboardUrl)
|
const target = new URL(instance.dashboardUrl)
|
||||||
|
|||||||
+38
-2
@@ -17,6 +17,8 @@ const instancesProxyPrefix = '/api/openshell/instances/'
|
|||||||
const dashboardProxySuffix = '/dashboard/proxy'
|
const dashboardProxySuffix = '/dashboard/proxy'
|
||||||
const defaultDashboardUrl = process.env.OPENCLAW_DASHBOARD_URL || 'http://127.0.0.1:18789/'
|
const defaultDashboardUrl = process.env.OPENCLAW_DASHBOARD_URL || 'http://127.0.0.1:18789/'
|
||||||
const defaultInstanceId = 'default'
|
const defaultInstanceId = 'default'
|
||||||
|
const sandboxDashboardPortBase = Number.parseInt(process.env.OPENCLAW_SANDBOX_DASHBOARD_PORT_BASE || '19000', 10)
|
||||||
|
const sandboxDashboardPortRange = 2000
|
||||||
|
|
||||||
function now() {
|
function now() {
|
||||||
return new Date().toISOString()
|
return new Date().toISOString()
|
||||||
@@ -115,7 +117,7 @@ function parseOpenClawInstanceRegistry() {
|
|||||||
function parseSandboxInstanceMap() {
|
function parseSandboxInstanceMap() {
|
||||||
const defaultMap = process.env.MY_ASSISTANT_OPENCLAW_INSTANCE_ID?.trim()
|
const defaultMap = process.env.MY_ASSISTANT_OPENCLAW_INSTANCE_ID?.trim()
|
||||||
? { 'my-assistant': process.env.MY_ASSISTANT_OPENCLAW_INSTANCE_ID.trim() }
|
? { 'my-assistant': process.env.MY_ASSISTANT_OPENCLAW_INSTANCE_ID.trim() }
|
||||||
: { 'my-assistant': defaultInstanceId }
|
: {}
|
||||||
const raw = process.env.OPENCLAW_SANDBOX_INSTANCE_MAP_JSON?.trim()
|
const raw = process.env.OPENCLAW_SANDBOX_INSTANCE_MAP_JSON?.trim()
|
||||||
if (!raw) return defaultMap
|
if (!raw) return defaultMap
|
||||||
|
|
||||||
@@ -144,12 +146,46 @@ function getDefaultOpenClawInstance() {
|
|||||||
function resolveOpenClawInstance(instanceId) {
|
function resolveOpenClawInstance(instanceId) {
|
||||||
const requested = typeof instanceId === 'string' ? instanceId.trim() : ''
|
const requested = typeof instanceId === 'string' ? instanceId.trim() : ''
|
||||||
if (!requested) return getDefaultOpenClawInstance()
|
if (!requested) return getDefaultOpenClawInstance()
|
||||||
|
const sandboxInstance = resolveSandboxOpenClawInstance(requested)
|
||||||
|
if (sandboxInstance) return sandboxInstance
|
||||||
return openClawInstances.find((entry) => entry.id === requested) || getDefaultOpenClawInstance()
|
return openClawInstances.find((entry) => entry.id === requested) || getDefaultOpenClawInstance()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMappedOpenClawInstanceId(sandboxId) {
|
function getMappedOpenClawInstanceId(sandboxId) {
|
||||||
const requested = typeof sandboxId === 'string' ? sandboxId.trim() : ''
|
const requested = typeof sandboxId === 'string' ? sandboxId.trim() : ''
|
||||||
return requested ? openClawSandboxInstanceMap[requested] || null : null
|
return requested ? openClawSandboxInstanceMap[requested] || buildSandboxOpenClawInstanceId(requested) : null
|
||||||
|
}
|
||||||
|
|
||||||
|
function hashSandboxId(value) {
|
||||||
|
let hash = 0
|
||||||
|
for (let index = 0; index < value.length; index += 1) {
|
||||||
|
hash = ((hash << 5) - hash + value.charCodeAt(index)) | 0
|
||||||
|
}
|
||||||
|
return Math.abs(hash)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSandboxOpenClawPort(sandboxId) {
|
||||||
|
return sandboxDashboardPortBase + (hashSandboxId(sandboxId) % sandboxDashboardPortRange)
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildSandboxOpenClawInstanceId(sandboxId) {
|
||||||
|
return `sandbox-${getSandboxOpenClawPort(sandboxId)}-${sandboxId}`
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveSandboxOpenClawInstance(instanceId) {
|
||||||
|
const requested = typeof instanceId === 'string' ? instanceId.trim() : ''
|
||||||
|
const match = requested.match(/^sandbox-(\d+)-(.+)$/)
|
||||||
|
if (!match) return null
|
||||||
|
const port = Number.parseInt(match[1], 10)
|
||||||
|
if (!Number.isFinite(port)) return null
|
||||||
|
return {
|
||||||
|
id: requested,
|
||||||
|
label: `OpenClaw for ${match[2]}`,
|
||||||
|
dashboardUrl: `http://127.0.0.1:${port}/`,
|
||||||
|
terminalServerUrl: process.env.TERMINAL_SERVER_URL || 'http://127.0.0.1:3011',
|
||||||
|
loopbackOnly: true,
|
||||||
|
default: false,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveDashboardUpstream(req) {
|
function resolveDashboardUpstream(req) {
|
||||||
|
|||||||
@@ -10,14 +10,24 @@ const sandboxListPath = path.join(root, 'app/components/SandboxList.tsx')
|
|||||||
const instancesSource = await readFile(instancesPath, 'utf8')
|
const instancesSource = await readFile(instancesPath, 'utf8')
|
||||||
assert.match(
|
assert.match(
|
||||||
instancesSource,
|
instancesSource,
|
||||||
/MY_ASSISTANT_OPENCLAW_INSTANCE_ID/,
|
/buildSandboxOpenClawInstanceId/,
|
||||||
'openclaw instance registry should expose a dedicated my-assistant env mapping seam'
|
'openclaw instance registry should synthesize per-sandbox dashboard instance ids'
|
||||||
|
)
|
||||||
|
assert.doesNotMatch(
|
||||||
|
instancesSource,
|
||||||
|
/: \{ 'my-assistant': DEFAULT_INSTANCE_ID \}/,
|
||||||
|
'my-assistant must not silently collapse to the default host dashboard'
|
||||||
)
|
)
|
||||||
assert.match(
|
assert.match(
|
||||||
instancesSource,
|
instancesSource,
|
||||||
/OPENCLAW_SANDBOX_INSTANCE_MAP_JSON/,
|
/OPENCLAW_SANDBOX_INSTANCE_MAP_JSON/,
|
||||||
'openclaw instance registry should allow additive sandbox->instance JSON mappings'
|
'openclaw instance registry should allow additive sandbox->instance JSON mappings'
|
||||||
)
|
)
|
||||||
|
assert.match(
|
||||||
|
instancesSource,
|
||||||
|
/getOpenClawDashboardPortForSandbox/,
|
||||||
|
'openclaw instance registry should allocate stable local tunnel ports per sandbox'
|
||||||
|
)
|
||||||
assert.match(
|
assert.match(
|
||||||
instancesSource,
|
instancesSource,
|
||||||
/export function resolveOpenClawInstanceForSandbox\(sandboxId\?: string \| null\)/,
|
/export function resolveOpenClawInstanceForSandbox\(sandboxId\?: string \| null\)/,
|
||||||
@@ -64,8 +74,8 @@ assert.match(
|
|||||||
const sandboxListSource = await readFile(sandboxListPath, 'utf8')
|
const sandboxListSource = await readFile(sandboxListPath, 'utf8')
|
||||||
assert.match(
|
assert.match(
|
||||||
sandboxListSource,
|
sandboxListSource,
|
||||||
/searchParams\.set\('sandboxId', selectedSandbox\.id\)/,
|
/searchParams\.set\('sandboxId', selectedSandbox\.name\)/,
|
||||||
'sandbox list must pass selected sandboxId when opening the dashboard'
|
'sandbox list must pass the selected sandbox name when opening the dashboard'
|
||||||
)
|
)
|
||||||
assert.match(
|
assert.match(
|
||||||
sandboxListSource,
|
sandboxListSource,
|
||||||
|
|||||||
Reference in New Issue
Block a user