Add gateway trust repair action

This commit is contained in:
Codex
2026-04-28 21:44:53 +00:00
parent 2f91d8b706
commit b17d3a292d
3 changed files with 135 additions and 0 deletions
+9
View File
@@ -14,6 +14,7 @@ const sandboxInferenceApplyRoutePath = path.join(root, 'app/api/sandbox/[sandbox
const sandboxInferenceApplyLibPath = path.join(root, 'app/lib/sandboxInferenceApply.ts')
const sandboxInferenceStorePath = path.join(root, 'app/lib/sandboxInferenceStore.ts')
const sandboxRestartRoutePath = path.join(root, 'app/api/sandbox/[sandboxId]/restart/route.ts')
const gatewayRepairRoutePath = path.join(root, 'app/api/openshell/gateway/repair/route.ts')
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')
@@ -33,6 +34,7 @@ const sandboxInferenceApplyRouteSource = await readFile(sandboxInferenceApplyRou
const sandboxInferenceApplyLibSource = await readFile(sandboxInferenceApplyLibPath, 'utf8')
const sandboxInferenceStoreSource = await readFile(sandboxInferenceStorePath, 'utf8')
const sandboxRestartRouteSource = await readFile(sandboxRestartRoutePath, 'utf8')
const gatewayRepairRouteSource = await readFile(gatewayRepairRoutePath, 'utf8')
const hookSource = await readFile(hookPath, 'utf8')
const pageSource = await readFile(pagePath, 'utf8')
const configPanelSource = await readFile(configPanelPath, 'utf8')
@@ -110,6 +112,13 @@ assert.match(sandboxRestartRouteSource, /restartMode: "openclaw-runtime"/, 'rest
assert.match(sandboxRestartRouteSource, /waitForSandboxReady\(sandboxName, 15000, 1000\)/, 'restart route must verify OpenShell reports the sandbox ready before runtime restart')
assert.match(sandboxListSource, /Restart OpenClaw Runtime/, 'sandbox details must expose a scoped runtime restart button')
assert.match(sandboxListSource, /\/api\/sandbox\/\$\{encodeURIComponent\(selectedSandbox\.id\)\}\/restart/, 'restart button must call the sandbox restart endpoint')
assert.match(gatewayRepairRouteSource, /gateway", "start", "--name", gateway/, 'gateway repair route must restart the selected OpenShell gateway')
assert.match(gatewayRepairRouteSource, /backupOpenShellConfig/, 'gateway repair route must back up OpenShell config before repair')
assert.match(gatewayRepairRouteSource, /\["sandbox", "list"\]/, 'gateway repair route must verify sandbox inventory after repair')
assert.match(pageSource, /BadSignature\|invalid peer certificate\|transport error\|certificate signature/, 'dashboard must detect gateway certificate trust failures')
assert.match(pageSource, /Repair Gateway Trust/, 'inventory error UI must expose a guarded gateway trust repair button')
assert.match(pageSource, /api\/openshell\/gateway\/repair/, 'gateway trust repair button must call the repair endpoint')
assert.match(pageSource, /It does not destroy sandboxes/, 'gateway trust repair warning must clarify sandboxes are not destroyed')
assert.doesNotMatch(sandboxListSource, /setInterval\(loadPermissionFeeds/, 'sandbox list must not poll every sandbox permission feed')
assert.match(sandboxListSource, /loadPermissionFeed\(selectedSandbox\)/, 'policy drawer must load the selected sandbox permission feed on demand')
assert.match(sandboxListSource, /<SandboxInferencePanel sandbox=\{selectedSandbox\}/, 'sandbox list must render the per-sandbox inference profile panel for the selected sandbox')