Refactor provider around fixed regions and friendly model ids

Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-08-31 17:11:18 +00:00
co-authored by Simon Shi
parent 63c517002e
commit 9d88e995ee
27 changed files with 400 additions and 488 deletions
+1 -5
View File
@@ -1,7 +1,6 @@
import type { OAuthCredentials } from "@earendil-works/pi-ai";
import { afterEach, describe, expect, it, vi } from "vitest";
const originalRegion = process.env.QODER_REGION;
const patEnvNames = [
"QODER_API_KEY",
"QODER_PERSONAL_ACCESS_TOKEN",
@@ -13,8 +12,6 @@ const patEnvNames = [
const originalPats = Object.fromEntries(patEnvNames.map((name) => [name, process.env[name]]));
afterEach(() => {
if (originalRegion === undefined) delete process.env.QODER_REGION;
else process.env.QODER_REGION = originalRegion;
for (const name of patEnvNames) {
const value = originalPats[name];
if (value === undefined) delete process.env[name];
@@ -25,8 +22,7 @@ afterEach(() => {
});
describe("provider region binding", () => {
it("keeps qoder global and qoder-cn in CN when QODER_REGION=cn", async () => {
process.env.QODER_REGION = "cn";
it("binds qoder to global and qoder-cn to CN", async () => {
for (const name of patEnvNames) delete process.env[name];
const providers = new Map<string, Record<string, unknown>>();
const pi = {