Add per-sandbox inference profiles
This commit is contained in:
@@ -8,20 +8,28 @@ const deleteRoutePath = path.join(root, 'app/api/sandbox/delete/route.ts')
|
||||
const telemetryRoutePath = path.join(root, 'app/api/telemetry/real/route.ts')
|
||||
const inferenceRoutePath = path.join(root, 'app/api/inference/route.ts')
|
||||
const ollamaModelsRoutePath = path.join(root, 'app/api/ollama/models/route.ts')
|
||||
const sandboxInferenceRoutePath = path.join(root, 'app/api/sandbox/[sandboxId]/inference/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')
|
||||
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')
|
||||
const sandboxListPath = path.join(root, 'app/components/SandboxList.tsx')
|
||||
|
||||
const createRouteSource = await readFile(createRoutePath, 'utf8')
|
||||
const deleteRouteSource = await readFile(deleteRoutePath, 'utf8')
|
||||
const telemetryRouteSource = await readFile(telemetryRoutePath, 'utf8')
|
||||
const inferenceRouteSource = await readFile(inferenceRoutePath, 'utf8')
|
||||
const ollamaModelsRouteSource = await readFile(ollamaModelsRoutePath, 'utf8')
|
||||
const sandboxInferenceRouteSource = await readFile(sandboxInferenceRoutePath, 'utf8')
|
||||
const hookSource = await readFile(hookPath, 'utf8')
|
||||
const pageSource = await readFile(pagePath, 'utf8')
|
||||
const configPanelSource = await readFile(configPanelPath, 'utf8')
|
||||
const inferencePanelSource = await readFile(inferencePanelPath, 'utf8')
|
||||
const sandboxInferencePanelSource = await readFile(sandboxInferencePanelPath, 'utf8')
|
||||
const sidebarSource = await readFile(sidebarPath, 'utf8')
|
||||
const sandboxListSource = await readFile(sandboxListPath, 'utf8')
|
||||
|
||||
assert.match(
|
||||
createRouteSource,
|
||||
@@ -59,6 +67,12 @@ assert.match(inferencePanelSource, /\/api\/ollama\/models/, 'settings UI must po
|
||||
assert.match(inferencePanelSource, /window\.setInterval\(\(\) => loadOllamaModels\(\{ silent: true \}\), 10000\)/, 'settings UI must autopoll Ollama while selected')
|
||||
assert.match(ollamaModelsRouteSource, /\/api\/tags/, 'Ollama models route must query the Ollama tags API')
|
||||
assert.match(ollamaModelsRouteSource, /OLLAMA_BASE_URL/, 'Ollama models route must support a configurable Ollama base URL')
|
||||
assert.match(sandboxInferenceRouteSource, /saveSandboxInferenceConfig/, 'sandbox inference route must persist per-sandbox inference profiles')
|
||||
assert.match(sandboxInferencePanelSource, /Save Sandbox Profile/, 'selected sandbox UI must expose per-sandbox inference profile saving')
|
||||
assert.match(sandboxInferencePanelSource, /\/api\/sandbox\/\$\{encodeURIComponent\(sandbox\.id\)\}\/inference/, 'selected sandbox UI must load and save sandbox-specific inference profiles')
|
||||
assert.match(sandboxInferencePanelSource, /\/api\/ollama\/models/, 'selected sandbox UI must offer Ollama model selection')
|
||||
assert.match(sandboxListSource, /<SandboxInferencePanel sandbox=\{selectedSandbox\} \/>/, 'sandbox list must render the per-sandbox inference profile panel for the selected sandbox')
|
||||
assert.match(sidebarSource, /Inference Endpoints/, 'sidebar settings item must be named Inference Endpoints')
|
||||
assert.match(pageSource, /<InferenceEndpointPanel \/>/, 'settings view must render inference endpoint panel')
|
||||
|
||||
assert.match(pageSource, /fetch\('\/api\/sandbox\/delete'/, 'destroy workflow must call the real sandbox delete endpoint')
|
||||
|
||||
Reference in New Issue
Block a user