@aliou/pi-neuralwatt 0.7.2 → 0.7.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliou/pi-neuralwatt",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
@@ -171,12 +171,21 @@ export default async function (pi: ExtensionAPI) {
171
171
  return { message };
172
172
  }
173
173
 
174
+ // Fallback for 429s where no layer-specific headers were captured. The
175
+ // streamSimple wrap (wrapNeuralwattStreamSimple) already formats a
176
+ // detailed message via formatRateLimitError when it captures headers;
177
+ // detect that case by the `"429 rate limit:"` prefix it emits and leave
178
+ // it untouched. This branch only fires for genuinely headerless 429s
179
+ // (e.g. anonymous playground limits, or a 429 from infra in front of
180
+ // Neuralwatt), since after_provider_response cannot observe 429s — the
181
+ // OpenAI SDK throws before Pi's onResponse hook runs.
174
182
  if (
175
183
  event.message.role === "assistant" &&
176
184
  event.message.stopReason === "error" &&
177
185
  (event.message.provider === "neuralwatt" ||
178
186
  ctx.model?.provider === "neuralwatt") &&
179
- event.message.errorMessage?.includes("429")
187
+ event.message.errorMessage?.includes("429") &&
188
+ !event.message.errorMessage.startsWith("429 rate limit:")
180
189
  ) {
181
190
  return {
182
191
  message: normalizeNeuralwattRateLimitError(event.message, {
@@ -10,19 +10,10 @@ import { NEURALWATT_MODELS } from "./public-models";
10
10
  // Per-ID overrides for known hidden models. The authenticated /v1/models endpoint
11
11
  // exposes pricing and capabilities, but some Pi-specific behavior (thinking levels,
12
12
  // compat flags) has to be supplied by hand.
13
+ // Previously hidden models that have since gone public now live in public-models.ts.
13
14
  const HIDDEN_MODEL_OVERRIDES: Partial<
14
15
  Record<string, Partial<ProviderModelConfig>>
15
- > = {
16
- "glm-5.2-short": {
17
- thinkingLevelMap: {
18
- minimal: null,
19
- low: null,
20
- medium: null,
21
- high: "high",
22
- xhigh: "max",
23
- },
24
- },
25
- };
16
+ > = {};
26
17
 
27
18
  function buildHiddenModel(apiModel: NeuralwattApiModel): ProviderModelConfig {
28
19
  const meta = apiModel.metadata;
@@ -49,6 +49,52 @@ export const NEURALWATT_MODELS: ProviderModelConfig[] = [
49
49
  maxTokensField: "max_tokens",
50
50
  },
51
51
  },
52
+ // GLM-5.2 Short - ZhipuAI (200K context, bounded reasoning budget)
53
+ {
54
+ id: "glm-5.2-short",
55
+ name: "GLM-5.2 Short",
56
+ reasoning: true,
57
+ input: ["text"],
58
+ cost: {
59
+ input: 1.45,
60
+ output: 4.5,
61
+ cacheRead: 0.3625,
62
+ cacheWrite: 0,
63
+ },
64
+ contextWindow: 199984,
65
+ maxTokens: 65536,
66
+ thinkingLevelMap: {
67
+ minimal: null,
68
+ low: null,
69
+ medium: null,
70
+ high: "high",
71
+ xhigh: "max",
72
+ },
73
+ compat: {
74
+ supportsDeveloperRole: false,
75
+ maxTokensField: "max_tokens",
76
+ requiresReasoningContentOnAssistantMessages: true,
77
+ },
78
+ },
79
+ // GLM-5.2 Short Fast - ZhipuAI (200K context, reasoning disabled)
80
+ {
81
+ id: "glm-5.2-short-fast",
82
+ name: "GLM-5.2 Short Fast",
83
+ reasoning: false,
84
+ input: ["text"],
85
+ cost: {
86
+ input: 1.45,
87
+ output: 4.5,
88
+ cacheRead: 0.3625,
89
+ cacheWrite: 0,
90
+ },
91
+ contextWindow: 199984,
92
+ maxTokens: 65536,
93
+ compat: {
94
+ supportsDeveloperRole: false,
95
+ maxTokensField: "max_tokens",
96
+ },
97
+ },
52
98
  // Kimi K2.5 - MoonshotAI
53
99
  {
54
100
  id: "moonshotai/Kimi-K2.5",