pi-cliproxyapi-native 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/package.json +4 -4
- package/src/compaction.ts +1 -1
package/README.md
CHANGED
|
@@ -27,15 +27,15 @@ Chat uses Pi's native API adapters and model metadata, with availability from yo
|
|
|
27
27
|
|
|
28
28
|
## Install
|
|
29
29
|
|
|
30
|
-
The extension targets Pi 1.
|
|
30
|
+
The extension targets Pi 1.4.0 and CLIProxyAPI 8.0.38, with Node.js 22.19 or newer. Run CLIProxyAPI with your upstream accounts configured before connecting Pi. The extension uses Pi's host-provided packages, adds no runtime dependencies, and needs no compilation.
|
|
31
31
|
|
|
32
32
|
If you installed `pi-cliproxy-native`, remove it before installing the renamed package. Both register the same `cliproxyapi` provider.
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
pi install npm:pi-cliproxyapi-native@0.2.
|
|
35
|
+
pi install npm:pi-cliproxyapi-native@0.2.2
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
For Git installation, use `pi install git:github.com/hawkff/pi-cliproxyapi-native@v0.2.
|
|
38
|
+
For Git installation, use `pi install git:github.com/hawkff/pi-cliproxyapi-native@v0.2.2`. For a local checkout, use `pi install /path/to/pi-cliproxyapi-native`.
|
|
39
39
|
|
|
40
40
|
The default proxy address is `http://localhost:8317`. For another address, set the [connection](#connection) before logging in. Restart Pi, then run:
|
|
41
41
|
|
|
@@ -226,9 +226,11 @@ Other chat routes retain the response-based fallback: `Retry-After` on HTTP 429
|
|
|
226
226
|
|
|
227
227
|
### Compaction
|
|
228
228
|
|
|
229
|
-
For automatic compaction and `/compact`, the extension limits medium or higher thinking to low without changing your chat thinking level. It uses Pi's default thinking budgets for these requests.
|
|
229
|
+
For automatic compaction and `/compact`, the extension limits medium or higher thinking to low without changing your chat thinking level. It uses Pi's default thinking budgets for these requests. Without an explicit output cap, summaries use the model's output limit. Pi's native adapters reduce the output allowance when needed to fit the remaining context space.
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
If a caller supplies a smaller cap and the summary hits it, the extension retries once with more output room, up to the model's output limit. An empty or thinking-only response gets one retry, including at the model's output limit.
|
|
232
|
+
|
|
233
|
+
Pi still selects which messages to summarize and retains recent history, previous summaries, custom instructions, and file tracking. Only the final response reaches the compactor, with usage from all attempts. Compaction fails rather than saving an incomplete summary. Cancellation, tool calls, and provider failures do not trigger these output retries; Pi keeps its configured transient-error retries and the extension keeps its quota handling.
|
|
232
234
|
|
|
233
235
|
Authentication failures, exhausted quotas, and inputs that exceed the model's context window still need correction. Run `/compact` after resolving the cause. The extension does not truncate history to force a summary or switch models. CLIProxyAPI's Responses compaction endpoint is separate from Pi's text-summary workflow.
|
|
234
236
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-cliproxyapi-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "CLIProxyAPI chat discovery and image/video generation with Pi's native adapters",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@biomejs/biome": "^2.5.13",
|
|
42
|
-
"@earendil-works/pi-ai": "^1.
|
|
43
|
-
"@earendil-works/pi-coding-agent": "^1.
|
|
44
|
-
"@earendil-works/pi-tui": "^1.
|
|
42
|
+
"@earendil-works/pi-ai": "^1.4.0",
|
|
43
|
+
"@earendil-works/pi-coding-agent": "^1.4.0",
|
|
44
|
+
"@earendil-works/pi-tui": "^1.4.0",
|
|
45
45
|
"@types/node": "^24.13.4",
|
|
46
46
|
"typescript": "5.9.3"
|
|
47
47
|
},
|
package/src/compaction.ts
CHANGED
|
@@ -10,7 +10,7 @@ export function withCompactionRecovery(
|
|
|
10
10
|
return lazyStream(model, async () => ({
|
|
11
11
|
async *[Symbol.asyncIterator]() {
|
|
12
12
|
const limit = model.maxTokens > 0 ? model.maxTokens : 32768;
|
|
13
|
-
let maxTokens = Math.max(1, Math.min(options.maxTokens ??
|
|
13
|
+
let maxTokens = Math.max(1, Math.min(options.maxTokens ?? limit, limit));
|
|
14
14
|
const reasoning =
|
|
15
15
|
options.reasoning && !["minimal", "low"].includes(options.reasoning) ? "low" : options.reasoning;
|
|
16
16
|
const run = () =>
|