fix: qoder-cn chat identity, content normalization, and Windows build
- Resolve the real Qoder identity (userID/email/name/machineID) from the job token at request time. OMP keeps login credentials in its own agent.db, not in ~/.pi/agent/auth.json, so a cache miss sent uid "qoder-user" and Qoder CN rejected it with "Login expired" (105). - Normalize the system prompt to a plain string. OMP supplies it as a single-element content array which Qoder's MessagesInputDto#content (String) rejects with 400 "Execution failed: set property" on qwen models. - Drop the modifyModels hook. OMP (Bun) structuredClones the whole model catalog before invoking it, and its bundled catalog is not cloneable, which removed qoder from `omp models`. - Make the build script cross-platform: use esbuild on PATH instead of a Unix-style ./node_modules path that fails on Windows cmd.exe.
This commit is contained in:
+5
-4
@@ -45,10 +45,11 @@ function createQoderOAuth(providerID: string, mode: string): OAuthConfigWithUsag
|
||||
login: isQoderCNMode(mode) ? loginQoderCN : loginQoder,
|
||||
refreshToken: isQoderCNMode(mode) ? refreshQoderTokenCN : refreshQoderToken,
|
||||
getApiKey: (cred: OAuthCredentials) => cred.access,
|
||||
modifyModels: (models: Model<Api>[], _cred: OAuthCredentials) => {
|
||||
const nonQoder = models.filter((m: Model<Api>) => m.provider !== providerID);
|
||||
return [...nonQoder, ...modelsForProvider(mode, providerID)];
|
||||
},
|
||||
// NOTE: no `modifyModels` hook on purpose. OMP (Bun) does a whole-catalog
|
||||
// structuredClone before invoking it, and its bundled catalog contains a
|
||||
// model with a non-cloneable property -> "The object can not be cloned."
|
||||
// removes qoder from `omp models`. Models are supplied at registration
|
||||
// via `modelsForProvider` and refreshed by the startup/session cache hooks.
|
||||
fetchUsage: isQoderCNMode(mode) ? fetchQoderUsageCN : fetchQoderUsage,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user