mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 07:04:48 +00:00
Surface aggregate status (error, provisioning, running, ready, no sandbox) as a colored pill in the transcript panel header. Integrates task runtime status, session status, and sandbox availability via the sandboxProcesses interest topic so the pill accurately reflects unreachable sandboxes. Includes mock tasks demonstrating error, provisioning, and running states, unit tests for deriveHeaderStatus, and workspace-dashboard integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { tmpdir } from "node:os";
|
|
import { join } from "node:path";
|
|
import { ConfigSchema, type AppConfig } from "@sandbox-agent/foundry-shared";
|
|
import type { BackendDriver } from "../../src/driver.js";
|
|
import { initActorRuntimeContext } from "../../src/actors/context.js";
|
|
import { createDefaultAppShellServices } from "../../src/services/app-shell-runtime.js";
|
|
|
|
export function createTestConfig(overrides?: Partial<AppConfig>): AppConfig {
|
|
return ConfigSchema.parse({
|
|
auto_submit: true,
|
|
notify: ["terminal" as const],
|
|
workspace: { default: "default" },
|
|
backend: {
|
|
host: "127.0.0.1",
|
|
port: 7741,
|
|
dbPath: join(tmpdir(), `hf-test-${Date.now()}-${Math.random().toString(16).slice(2)}.db`),
|
|
opencode_poll_interval: 2,
|
|
github_poll_interval: 30,
|
|
backup_interval_secs: 3600,
|
|
backup_retention_days: 7,
|
|
},
|
|
providers: {
|
|
local: {},
|
|
e2b: {},
|
|
},
|
|
...overrides,
|
|
});
|
|
}
|
|
|
|
export function createTestRuntimeContext(driver: BackendDriver, configOverrides?: Partial<AppConfig>): { config: AppConfig } {
|
|
const config = createTestConfig(configOverrides);
|
|
initActorRuntimeContext(config, undefined, driver, createDefaultAppShellServices());
|
|
return { config };
|
|
}
|