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:
xing.huang
2026-08-18 12:22:47 +08:00
parent 9820845768
commit 443e4ad6a7
5 changed files with 87 additions and 18 deletions
+1 -1
View File
@@ -19,7 +19,7 @@
"README.md"
],
"scripts": {
"build": "./node_modules/esbuild/bin/esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:@earendil-works/pi-ai --external:@earendil-works/pi-coding-agent",
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:@earendil-works/pi-ai --external:@earendil-works/pi-coding-agent",
"check": "node node_modules/typescript/bin/tsc --noEmit",
"lint": "node node_modules/@biomejs/biome/bin/biome check .",
"lint:fix": "node node_modules/@biomejs/biome/bin/biome check --write .",