Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Workers: a whole graph is taken only for a job named as the owner's own

Adarsh174984881259
diff --git a/src/lib/computer-runner.ts b/src/lib/computer-runner.ts
index 0f6d0cae..4be5cdf1 100644
--- a/src/lib/computer-runner.ts
+++ b/src/lib/computer-runner.ts
@@ -745,7 +745,8 @@ export class ComputerRunner {
return null;
}
if (!t.graph || typeof t.graph !== "object") return "bad-ticket";
- if (worker && ((t.class !== undefined && t.class !== "owner") || worker.graphs === false)) return "bad-ticket";
+ // A studio names the owner's own job "owner"; a graph for any other job, or for one that names no class, is refused.
+ if (worker && (t.class !== "owner" || worker.graphs === false)) return "bad-ticket";
if (worker?.inside && !worker.inside(t)) return "outside-ceiling";
return null;
}
diff --git a/tests/worker-tickets.test.ts b/tests/worker-tickets.test.ts
index 6cf9c3e9..7616990b 100644
--- a/tests/worker-tickets.test.ts
+++ b/tests/worker-tickets.test.ts
@@ -466,6 +466,25 @@ describe("the worker program composes tickets and keeps to its PC's ceiling", ()
expect(p.logs.some((l) => /Starting its own ComfyUI/.test(l))).toBe(true);
});
+ it("a raw graph that names no class is refused too", async () => {
+ const w = addWorker();
+ const s = studio();
+ const p = pc();
+ const mine = await accountTask();
+ s.rewrite = (q, body) => {
+ if (q !== "/api/gpu/computer/claim") return body;
+ const { task } = body as { task: Record<string, unknown> };
+ const { ticket: _t, class: _c, ...rest } = task;
+ void _t;
+ void _c;
+ return { task: { ...rest, graph: mine.graph } };
+ };
+ start(w, s, p);
+ expect((await ended(mine.id)).state).toBe("failed");
+ expect(s.reports).toContainEqual({ event: "failed", reason: "bad-ticket" });
+ expect(prompts(p)).toBe(0);
+ });
+
it("with acceptGraphs off, the owner's own whole graph is refused too", async () => {
const w = addWorker();
const s = studio();