Files
pi-provider-qoder/package.json
T
liyanan 273368fc0e fix: prevent provider_error 400 on dmodel/ultimate by using content placeholder
When assistant messages contain only tool_calls (no text/thinking), transform.ts
was setting content to null. Qoder's gateway drops these null-content assistant
messages, orphaning the following tool_result and causing upstream rejections:
- dmodel (OpenAI): 'tool must follow a message with tool_calls'
- ultimate (Anthropic): 'unexpected tool_use_id in tool_result blocks'

Analysis of 28 historical sessions showed 100% failure rate on dmodel and 75%
on ultimate for this pattern, while auto/GLM5.2 (GLM upstream) tolerated it.

Fix: inject a single-space placeholder when tool_calls are present but content
is empty, so the gateway preserves the assistant message and tool pairing stays
valid.

Also fixes pre-existing lint formatting in stream.ts and package.json.
Adds regression test for the full assistant+toolResult pairing scenario.
2026-07-26 15:26:13 +08:00

54 lines
1.6 KiB
JSON

{
"name": "pi-provider-qoder",
"version": "0.2.9-fix.1",
"description": "Pi extension for Qoder AI \u2014 with OAuth authentication, COSY signatures and WAF bypass",
"type": "module",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"keywords": [
"pi-package",
"pi",
"qoder",
"ai",
"provider"
],
"files": [
"dist",
"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",
"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 .",
"format": "node node_modules/@biomejs/biome/bin/biome format --write .",
"test": "vitest run",
"test:watch": "vitest",
"prepare": "npm run build",
"prepublishOnly": "npm run check && npm run build"
},
"pi": {
"extensions": [
"./dist/index.js"
]
},
"devDependencies": {
"@biomejs/biome": "2.4.2",
"@earendil-works/pi-ai": "^0.80.2",
"@earendil-works/pi-coding-agent": "^0.80.2",
"esbuild": "^0.28.1",
"typescript": "^5.7.0",
"vitest": "^4.1.9"
},
"repository": {
"type": "git",
"url": "git+https://github.com/simonsmh/pi-provider-qoder.git"
},
"bugs": {
"url": "https://github.com/simonsmh/pi-provider-qoder/issues"
},
"homepage": "https://github.com/simonsmh/pi-provider-qoder#readme"
}