fix(docker): run real questions through trusted Pi gate
This commit is contained in:
@@ -127,6 +127,17 @@ test("spawnFor default (new) mode sends /nuova-domanda", async () => {
|
||||
mgr.teardown("sid-10");
|
||||
});
|
||||
|
||||
test("spawnFor new mode forwards the real question instead of kickoff", async () => {
|
||||
const cfg = loadConfig({});
|
||||
const child = recordingChild();
|
||||
const mgr = new PiProcessManager(cfg, { spawnFn: () => child as any });
|
||||
await mgr.spawnFor("sid-question", { question: "pazienti con cardioversione e ILR" });
|
||||
const prompt = JSON.parse(child._writes.at(-1)!);
|
||||
expect(prompt.message).toBe('/nuova-domanda "pazienti con cardioversione e ILR"');
|
||||
expect(prompt.message).not.toContain("kickoff");
|
||||
mgr.teardown("sid-question");
|
||||
});
|
||||
|
||||
test("production spawn uses explicit Pi path and passes portable data root without rewriting PATH", async () => {
|
||||
vi.stubEnv("PATH", "/usr/local/bin:/usr/bin");
|
||||
vi.stubEnv("PI_PROVIDER_API_KEY", "provider-secret");
|
||||
|
||||
Reference in New Issue
Block a user