fix: render registry workspaces for harness

This commit is contained in:
2026-08-05 16:03:45 +02:00
parent ece9cfda50
commit bd798b1c96
21 changed files with 659 additions and 69 deletions
+21
View File
@@ -168,6 +168,27 @@ function recordingChild() {
return ch;
}
test("Pi receives the leased workspace runtime config and releases it on direct teardown", () => {
const child = recordingChild();
let spawnEnv: NodeJS.ProcessEnv | undefined;
const release = vi.fn();
const mgr = new PiProcessManager(loadConfig({}), {
spawnFn: (_command, _args, options) => {
spawnEnv = options.env;
return child as any;
},
});
mgr.createFor("canonical-runtime", {
runtimeConfig: { path: "/trusted/runtime-uuid.yaml", release },
} as any);
expect(spawnEnv?.THT_CONFIG).toBe("/trusted/runtime-uuid.yaml");
// The child deliberately emits neither exit nor close. Ownership cleanup must not depend on it.
mgr.teardown("canonical-runtime");
expect(release).toHaveBeenCalledOnce();
});
test.each([
["new", "auth.json", '{"deepseek":{"key":"!runtime-auth-command runtime-secret /private/runtime-auth"}}\n'],
["new", "models.json", '{"providers":{"local-qwen":{"headers":["!runtime-model-command runtime-secret /private/runtime-model"]}}}\n'],