fix: read prompt and tools from the transcript
CI / Lint, typecheck & build (push) Failing after 32s

pi 0.87 made the session transcript canonical for provider context: the
context handed to a custom provider's stream no longer carries
`systemPrompt` and `tools`; they live on the leading system message
(`sections` + `toolsAdded`). streamQoder still read the removed fields,
so every request went out with `system: ""` and `tools: []` - the model
saw no prompt and no tools and answered that it cannot access files.

- resolve the prompt with getCurrentSystemPrompt(messages) and the tool
  list with getCurrentTools(messages)
- give tool parameters a root `type: "object"`: Qoder's upstream rejects
  a union root ("schema must be a JSON Schema of 'type: \"object\"', got
  'type: null'"), e.g. the agent-browser Electron tool, which failed the
  whole request with a 400
- bump the pi-ai / pi-coding-agent devDependencies to ^0.87.1 and cover
  the transcript prompt/tools path with a regression test
This commit is contained in:
2026-09-29 10:18:44 +08:00
parent d0d69617da
commit 9821439603
6 changed files with 945 additions and 1288 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "pi-provider-qoder",
"version": "0.4.5",
"version": "0.4.6",
"description": "Pi extension for Qoder AI — with OAuth authentication, COSY signatures and WAF bypass",
"type": "module",
"license": "MIT",
@@ -37,8 +37,8 @@
},
"devDependencies": {
"@biomejs/biome": "2.5.12",
"@earendil-works/pi-ai": "^0.85.1",
"@earendil-works/pi-coding-agent": "^0.85.1",
"@earendil-works/pi-ai": "^0.87.1",
"@earendil-works/pi-coding-agent": "^0.87.1",
"esbuild": "^0.28.1",
"tsx": "^4.23.13",
"typescript": "^5.7.0",