@router-for-me/pi-cliproxyapi-provider 1.4.9 → 1.4.10

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 CHANGED
@@ -91,7 +91,7 @@ You can still configure without `/login`.
91
91
  Optional fields:
92
92
 
93
93
  | Field | Default | Description |
94
- |-------|---------|-------------|
94
+ | ------- | --------- | ------------- |
95
95
  | `baseUrl` | `http://127.0.0.1:8317` | CLIProxyAPI address |
96
96
  | `apiKey` | _(required unless set via /login or env)_ | Bearer token / CPA API key |
97
97
  | `providerId` | `cliproxyapi` | Provider id shown in `/model` |
@@ -101,7 +101,7 @@ Optional fields:
101
101
  ### Environment overrides
102
102
 
103
103
  | Variable | Overrides |
104
- |----------|-----------|
104
+ | ---------- | ----------- |
105
105
  | `CLIPROXYAPI_BASE_URL` | `baseUrl` |
106
106
  | `CLIPROXYAPI_API_KEY` | `apiKey` |
107
107
  | `CLIPROXYAPI_PROVIDER_ID` | `providerId` |
@@ -122,7 +122,7 @@ The Fast preference resolves separately as `CLIPROXYAPI_FAST` → `cliproxyapi.j
122
122
  Preferred form is **host:port only**:
123
123
 
124
124
  | Input | Inference baseUrl | Models URL |
125
- |-------|-------------------|------------|
125
+ | ------- | ------------------- | ------------ |
126
126
  | `http://127.0.0.1:8317` | `http://127.0.0.1:8317/backend-api/` | `http://127.0.0.1:8317/v1/models?client_version=pi` |
127
127
  | `http://127.0.0.1:8317/backend-api` | `http://127.0.0.1:8317/backend-api/` | same models URL |
128
128
  | `http://127.0.0.1:8317/v1` | `http://127.0.0.1:8317/backend-api/` | same models URL |
@@ -179,7 +179,7 @@ In the TUI footer, CLIProxyAPI context usage also uses this effective threshold
179
179
  From CPA catalog entry → pi model:
180
180
 
181
181
  | CPA field | Pi field |
182
- |-----------|----------|
182
+ | ----------- | ---------- |
183
183
  | `slug` | `id` |
184
184
  | `display_name` | `name` |
185
185
  | `context_window` | `contextWindow` |
@@ -1,14 +1,15 @@
1
1
  import { type AssistantMessage, isRetryableAssistantError } from "@earendil-works/pi-ai";
2
2
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
3
 
4
- const CLOSED_NETWORK_CONNECTION_PATTERN = /\bclosed network connection\b/i;
4
+ const TRANSIENT_STREAM_ERROR_PATTERN =
5
+ /\bclosed network connection\b|\bstream disconnected before completion: stream closed before response\.completed\b|\binvalid SSE data JSON\b/i;
5
6
  const NETWORK_ERROR_PREFIX = "network error:";
6
7
 
7
8
  export function normalizeTransientNetworkError(message: AssistantMessage): AssistantMessage {
8
9
  if (message.stopReason !== "error" || !message.errorMessage) {
9
10
  return message;
10
11
  }
11
- if (isRetryableAssistantError(message) || !CLOSED_NETWORK_CONNECTION_PATTERN.test(message.errorMessage)) {
12
+ if (isRetryableAssistantError(message) || !TRANSIENT_STREAM_ERROR_PATTERN.test(message.errorMessage)) {
12
13
  return message;
13
14
  }
14
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@router-for-me/pi-cliproxyapi-provider",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "description": "Pi provider extension that auto-registers CLIProxyAPI models, plus TUI elapsed/TPS status",
5
5
  "type": "module",
6
6
  "keywords": [