Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(#6436): the endpoint-switch test expects the manual effort levels

milind-sonia4ae9e82d876
diff --git a/server/provider-key-flow.test.ts b/server/provider-key-flow.test.ts
index cfbda86031..71a98a743a 100644
--- a/server/provider-key-flow.test.ts
+++ b/server/provider-key-flow.test.ts
@@ -98,6 +98,9 @@ it("saving and replacing a workspace key reaches an existing bot's next request
}
});
+/** #6436: an OpenAI-compatible model with no listed efforts offers the manual levels. */
+const EFFORTS = ["low", "medium", "high", "xhigh", "max"].map((id) => ({ id, label: id }));
+
it("switching the workspace endpoint moves discovery and existing chats without changing a private connection", async () => {
const received: Array<{ provider: string; path: string; key: string }> = [];
const providers = ["first", "second"].map((name) => createServer((req, res) => {
@@ -167,8 +170,7 @@ it("switching the workspace endpoint moves discovery and existing chats without
expect(received.filter((request) => request.provider === "first").map((request) => request.key))
.not.toContain("Bearer fixture-second-key");
expect(instances.find((instance: { instanceId: string }) => instance.instanceId === "openaiCompat").models.options)
- .toEqual([{ id: "fixture-shared-model", label: "fixture-shared-model", custom: true },
- { id: "fixture-second-model", label: "fixture-second-model", custom: true }]);
+ .toEqual(["fixture-shared-model", "fixture-second-model"].map((id) => ({ id, label: id, custom: true, variants: EFFORTS })));
await send(bot, "second provider reply");
expect(received).toContainEqual({ provider: "second", path: "/v1/chat/completions", key: "Bearer fixture-second-key" });