fix: make join approval atomic
This commit is contained in:
@@ -106,6 +106,33 @@ test("POST /sessions/:id/resume configura Pi con il thinking persistito", async
|
||||
expect(configured.thinking).toBe("medium");
|
||||
});
|
||||
|
||||
test("POST /sessions/:id/resume usa il thinking globale se manca nel manifest", async () => {
|
||||
let configured: any;
|
||||
const bridge = { onClientEvent: () => {}, emitClientEvent: () => {} };
|
||||
const runtime = { bridge } as any;
|
||||
const mgr = {
|
||||
get: () => undefined,
|
||||
createFor: () => runtime,
|
||||
configure: async (_rt: any, options: any) => { configured = options; },
|
||||
start: () => {},
|
||||
teardown: () => {},
|
||||
} as any;
|
||||
const app = buildApp(loadConfig({ THT_HARNESS_DIR: "../harness" }), {
|
||||
mgr,
|
||||
thtRunner: {
|
||||
ollamaEnsure: async () => ({ ok: true }),
|
||||
sessionShow: async () => ({ status: "open", archived: false }),
|
||||
reopenSession: async () => {},
|
||||
} as any,
|
||||
getSettings: () => ({ workspace: "psd", thinking: "low" }) as any,
|
||||
});
|
||||
|
||||
await app.inject({ method: "POST", url: "/sessions/s-thinking/resume" });
|
||||
await new Promise((resolve) => setImmediate(resolve));
|
||||
|
||||
expect(configured.thinking).toBe("low");
|
||||
});
|
||||
|
||||
test("POST /sessions/:id/response inoltra al bridge (no error)", async () => {
|
||||
const app = buildApp(loadConfig({ THT_HARNESS_DIR: "../harness" }), {
|
||||
thtRunner: {
|
||||
|
||||
Reference in New Issue
Block a user