@eddyskywalker/dsh-chatgpt-subscription 0.17.1 → 0.18.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.18.0 - 2026-10-11
6
+
7
+ - **[MiniMax Code] 额度耗尽后不换号,而且把「限流」判成了「欠费」**
8
+ - **这条线路是唯一一条有号池却完全没有号池行为的线路。** 全包共 7 条线路(codex / claude / kimi-code / command-code / ollama / workbuddy / antigravity)都在非 2xx 的 429 上 `markCooldown` 并 `hasAnotherAvailableAccount(tried) → continue`;MiniMax 的 `src/host/minimax-code/` 全目录**零次** `markCooldown` 调用,`getEffectiveCredential(undefined, …)` 的 `excludeIds` 恒为空。于是某一个账号的 Token Plan 跑光之后,**后面每一个请求都继续由它来服务**——号池选它、被拒、再选它,没有任何一处在学习「它已经被拒过」。
9
+ - **结果是用户看不到换号,只看到额度耗尽。** 冷却机制本身是好的(`isEligible` 是纯时间比较,到期自动恢复),问题只在于从不写入。
10
+ - **识别层把普通限流判成了终局欠费。** 旧表里 `/exceeded/i` / `/quota/i` / `/balance/i` 是**裸词**,于是 `{"errorCode":1002,"errorReason":"rate_limit_exceeded"}` 这种最标准的限流信封被判成 `PROVIDER_ERROR` / `retryable:false` ——**本该由 DSH 有界退避重试的请求直接硬失败**。现在收紧为短语并补上本服务实际使用的中文措辞(余额/额度/配额 不足|耗尽|用尽、请充值、欠费、超出额度),且刻意**不**收录裸的「限制」「上限」,因为「请求超过频率限制」是标准限流句,必须继续保持可重试。
11
+ - **`summarizeFailureBody` 不认 `base_resp.status_msg`。** 那正是本线路在配额、Files API、签到三处都在解析的信封,用户此前会被展示一整个原始 JSON,而它唯一的内容就是那句话。
12
+ - **现在与兄弟线路同形**:新增 `accountScoped` 分类字段(沿用 kimi-code 的字段名与语义),429 冷却后在同一轮内换号重试;轮换循环按轮重建凭据、超大媒体上传与请求体,因此重放出来的请求绝不会指向另一个账号上传的文件 id(`uploadOversizedMedia` 把 access token 与 account key 一起交给 Files API,这是本线路独有的真实耦合)。
13
+ - **403 形态的额度耗尽一并处理,且不与凭据类 403 混淆。** 判别顺序是「先跑额度表、再落到凭据分支」,并且**状态码是外层条件**——任何 401 无论 body 写什么都进不了冷却分支,否则一个坏 token 会把整个号池走一遍。凭据提示语改为按**分类**挂载,额度耗尽的 403 不会再顺带甩一句 `sha256:…` 去怪那枚刚续期过的 token。
14
+ - **额度型 403 不再白花一次强制续期。** 这是上一版行为里最贵的一处:`renewCredential` 对「窗口已耗尽」毫无帮助,而对原生账号(凭据就是桌面端自己的 `auth.json`,池内 adopted never destroyed)那次续期会**把一对新令牌写回用户的桌面端文件**。现在有号池且 body 命中额度表时直接交给号池分支。**无号池路径刻意不跳过**:那里续期推进的是插件自己的凭据文件,且最终抛出的 detail 来自重放后的响应,跳过会改掉用户看到的文案。
15
+ - **401/403 不写 `markAuthFailed`,而且这是有证据的结论。** 适配器永远不会分类一个没先续期过的 401/403;能走到号池分支的必然是刚轮换出来的新令牌仍被拒。而「凭据不可用」早有两条更可靠的写入路径(`refreshFailureStatus` 在令牌端点最终拒绝时写 `authStatus`,`authRejectedReason` 另有免写入的排除)。在请求阶段补写反而制造**不可自愈的假阳性**:续期成功时新令牌对已经写进桌面端 `auth.json`,于是 `healStaleAuthFailures` 的四个条件一个都不满足——一次瞬时 403 会把正在使用的桌面账号**永久**标成「需要重新登录」,理由还是错的。现状已用测试钉住。
16
+ - 测试:新增 `test/minimax-code-429-cooldown.test.ts`(28 例),核心断言是「**一次** `adapter.stream()` 调用内,第一个账号 429 额度耗尽 → 第二个账号给出答案」,即 `['Bearer at-1', 'Bearer at-2']` 的鉴权顺序 + 调用方拿到 `text-delta` 而非异常。另覆盖:额度型 403 换号且 `tokenCalls === 0`、凭据型 401/403 **不冷却不轮换**(含单账号池与双账号池)、400/5xx 不轮换、原生桌面账号不被标记也不被冷却、in-band 429 只冷却、无号池路径逐字不变、以及「额度判决不会因为 body 被读两次而退化成凭据判决」。承重已用变异测试验证(禁用新门 → 2 红;去掉 body 复用 → 4 红,报错正是 `expected 'INVALID_CREDENTIAL' to be 'PROVIDER_ERROR'`)。
17
+ - 验证:`npm run typecheck` 0 错误;全量 `npm test` **3013 passed / 7 skipped, 0 failed**(较 0.17.1 的 2985 增 28 例,基线 2994 增 19 例)。未改共享内核、UI、DTO、路由。
18
+ - **未一并处理的**:① 无号池的额度型 403 仍会多花一次续期(上一段说明的取舍);② in-band(流式事件)的账号级 429 只能冷却、不能换号——响应体已经开着读了一半,结构上换不了,这是 7 条线路的共同限制,不是本线路独有。
5
19
  ## 0.17.1 - 2026-10-10
6
20
 
7
21
  - **[Kimi Code] 请求体超限时,「还有图可丢吗」的判定与计量脱节,兜底一次都没跑([#51](https://github.com/Aa728848/dsh-chatgpt-subscription/issues/51))**
package/lib/index.js CHANGED
@@ -15940,7 +15940,7 @@ function classifyCommandCodeFailure(status, detail) {
15940
15940
  };
15941
15941
  }
15942
15942
  /** Cooldown one rate-limited key takes when the provider states no delay. */
15943
- const POOL_COOLDOWN_MS$4 = 15 * 6e4;
15943
+ const POOL_COOLDOWN_MS$5 = 15 * 6e4;
15944
15944
  var CommandCodeAdapter = class extends LlmAdapter {
15945
15945
  store;
15946
15946
  modelSettings;
@@ -16125,7 +16125,7 @@ var CommandCodeAdapter = class extends LlmAdapter {
16125
16125
  }
16126
16126
  if (response.status === 429) {
16127
16127
  const after = retryAfterMs$1(response.headers);
16128
- await pool.markCooldown(accountId, after ?? POOL_COOLDOWN_MS$4, `${PROVIDER_NAME$5} 429`).catch(() => void 0);
16128
+ await pool.markCooldown(accountId, after ?? POOL_COOLDOWN_MS$5, `${PROVIDER_NAME$5} 429`).catch(() => void 0);
16129
16129
  if (await pool.hasAnotherAvailableAccount(tried)) continue;
16130
16130
  break;
16131
16131
  }
@@ -16198,7 +16198,7 @@ var CommandCodeAdapter = class extends LlmAdapter {
16198
16198
  const reclassified = reclassifyInBandStreamError(error, inBand);
16199
16199
  if (reclassified.code === "RATE_LIMIT" && pool !== null && accountId !== void 0) {
16200
16200
  const after = retryAfterMs$1(response.headers);
16201
- await pool.markCooldown(accountId, after ?? POOL_COOLDOWN_MS$4, `${PROVIDER_NAME$5} in-stream 429`).catch(() => void 0);
16201
+ await pool.markCooldown(accountId, after ?? POOL_COOLDOWN_MS$5, `${PROVIDER_NAME$5} in-stream 429`).catch(() => void 0);
16202
16202
  }
16203
16203
  throw reclassified;
16204
16204
  }
@@ -17341,7 +17341,7 @@ const CATALOG_TIMEOUT_MS = 15e3;
17341
17341
  * A 429 here is a real quota or rate limit, not a blip, so the account is parked
17342
17342
  * for long enough that the next request goes to a different one.
17343
17343
  */
17344
- const POOL_COOLDOWN_MS$3 = 15 * 6e4;
17344
+ const POOL_COOLDOWN_MS$4 = 15 * 6e4;
17345
17345
  /**
17346
17346
  * NO fallback model names.
17347
17347
  *
@@ -18453,7 +18453,7 @@ var OllamaAdapter = class extends LlmAdapter {
18453
18453
  break;
18454
18454
  }
18455
18455
  if (lastStatus === 429) {
18456
- await pool.markCooldown(accountId, POOL_COOLDOWN_MS$3, `${PROVIDER_NAME$4} 429`).catch(() => void 0);
18456
+ await pool.markCooldown(accountId, POOL_COOLDOWN_MS$4, `${PROVIDER_NAME$4} 429`).catch(() => void 0);
18457
18457
  if (await pool.hasAnotherAvailableAccount(tried)) continue;
18458
18458
  break;
18459
18459
  }
@@ -24007,11 +24007,11 @@ function accountLimitCooldownMs(bodyText, now = Date.now()) {
24007
24007
  const field = bodyText.match(RESET_FIELD_PATTERN);
24008
24008
  const instant = bodyText.match(RESET_INSTANT_PATTERN);
24009
24009
  const resetsAt = field !== null ? parseTimestamp(Number(field[1])) : instant !== null ? Date.parse(instant[0].replace(" ", "T")) : null;
24010
- if (resetsAt !== null && Number.isFinite(resetsAt) && resetsAt > now) return Math.min(Math.max(resetsAt - now, POOL_COOLDOWN_MS$2), MAX_ACCOUNT_LIMIT_COOLDOWN_MS);
24010
+ if (resetsAt !== null && Number.isFinite(resetsAt) && resetsAt > now) return Math.min(Math.max(resetsAt - now, POOL_COOLDOWN_MS$3), MAX_ACCOUNT_LIMIT_COOLDOWN_MS);
24011
24011
  return BILLING_CYCLE_PATTERN.test(bodyText) ? BILLING_CYCLE_COOLDOWN_MS : ACCOUNT_LIMIT_COOLDOWN_MS;
24012
24012
  }
24013
24013
  /** Cooldown one rate-limited account takes when the provider states no delay. */
24014
- const POOL_COOLDOWN_MS$2 = 15 * 6e4;
24014
+ const POOL_COOLDOWN_MS$3 = 15 * 6e4;
24015
24015
  /**
24016
24016
  * Fallback cooldown for an account whose usage window is spent.
24017
24017
  *
@@ -24238,7 +24238,7 @@ var KimiCodeAdapter = class extends LlmAdapter {
24238
24238
  if (pool !== null && accountId !== void 0) {
24239
24239
  const planScoped = response.status === 429 && matchesAny$1(detail, ENTITLEMENT_PATTERNS);
24240
24240
  if (response.status === 429 && !planScoped) {
24241
- const cooldownMs = failure.accountScoped ? accountLimitCooldownMs(detail) : after ?? POOL_COOLDOWN_MS$2;
24241
+ const cooldownMs = failure.accountScoped ? accountLimitCooldownMs(detail) : after ?? POOL_COOLDOWN_MS$3;
24242
24242
  await pool.markCooldown(accountId, cooldownMs, `${PROVIDER_NAME$3} 429`).catch(() => void 0);
24243
24243
  if (await pool.hasAnotherAvailableAccount(tried)) continue;
24244
24244
  } else if (failure.code === "INVALID_CREDENTIAL") {
@@ -24349,7 +24349,7 @@ var KimiCodeAdapter = class extends LlmAdapter {
24349
24349
  * account back into rotation four times inside the window that refused it.
24350
24350
  */
24351
24351
  async coolInBandRateLimit(pool, accountId, accountScoped, bodyText) {
24352
- const cooldownMs = accountScoped ? accountLimitCooldownMs(bodyText) : POOL_COOLDOWN_MS$2;
24352
+ const cooldownMs = accountScoped ? accountLimitCooldownMs(bodyText) : POOL_COOLDOWN_MS$3;
24353
24353
  await pool.markCooldown(accountId, cooldownMs, `${PROVIDER_NAME$3} in-stream 429`).catch(() => void 0);
24354
24354
  }
24355
24355
  };
@@ -28439,6 +28439,8 @@ function summarizeFailureBody(raw) {
28439
28439
  if (typeof message === "string") return message.slice(0, 400);
28440
28440
  const nestedMessage = asRecord$5(record.error)?.message;
28441
28441
  if (typeof nestedMessage === "string") return nestedMessage.slice(0, 400);
28442
+ const baseResp = asRecord$5(record.base_resp)?.status_msg;
28443
+ if (typeof baseResp === "string") return baseResp.slice(0, 400);
28442
28444
  }
28443
28445
  } catch {}
28444
28446
  return text.slice(0, 400);
@@ -29194,24 +29196,109 @@ const MINIMAX_CODE_RETRY_POLICY_CONFIG = {
29194
29196
  };
29195
29197
  const RETRY_POLICY$2 = resolveRetryPolicy(MINIMAX_CODE_RETRY_POLICY_CONFIG, "dsh-chatgpt-subscription.minimax-code.retry");
29196
29198
  /**
29199
+ * Cooldown one rate-limited account takes when the service states no delay.
29200
+ *
29201
+ * The length every sibling line defaults to (command-code:243, kimi-code:476,
29202
+ * ollama/types.ts:115, responses-client.ts:28), so a deployment reading these rows
29203
+ * across lines sees one number rather than four.
29204
+ */
29205
+ const POOL_COOLDOWN_MS$2 = 15 * 6e4;
29206
+ /**
29207
+ * Fallback cooldown for an account whose Token Plan window is spent.
29208
+ *
29209
+ * The 15 minutes a plain 429 gets would put the account back into rotation several
29210
+ * times inside the very window that just refused it, which is the same reason
29211
+ * kimi-code gives for its own ACCOUNT_LIMIT_COOLDOWN_MS (kimi-code/adapter.ts:478-485).
29212
+ * The Token Plan reports a 5-hour interval window and a weekly one, so each length is
29213
+ * used for the window it actually describes.
29214
+ */
29215
+ const QUOTA_WINDOW_COOLDOWN_MS = 300 * 6e4;
29216
+ /**
29217
+ * A weekly window is not an interval window: cooling five hours would spend a request
29218
+ * every five hours to learn an answer that changes at most once a week.
29219
+ */
29220
+ const WEEKLY_WINDOW_COOLDOWN_MS = 10080 * 6e4;
29221
+ /** Body text naming the weekly window rather than the interval one. */
29222
+ const WEEKLY_QUOTA_WINDOW_PATTERN = /weekly|周(?:额度|配额|重置|窗口)|每周/iu;
29223
+ /**
29224
+ * The cooldown one exhausted account takes, read from the body that named the verdict.
29225
+ *
29226
+ * Deliberately never a Retry-After. That header is back-pressure arithmetic — come
29227
+ * back in N seconds — and a spent plan window does not become unspent by waiting N
29228
+ * seconds. kimi-code/adapter.ts:840-845 states the same reasoning for its own exhausted
29229
+ * balance, and two lines must not disagree about a rule this shared.
29230
+ */
29231
+ function quotaCooldownMs(bodyText) {
29232
+ return WEEKLY_QUOTA_WINDOW_PATTERN.test(bodyText) ? WEEKLY_WINDOW_COOLDOWN_MS : QUOTA_WINDOW_COOLDOWN_MS;
29233
+ }
29234
+ /**
29197
29235
  * Body text the service uses for an account-level refusal that retrying cannot fix.
29198
29236
  *
29199
29237
  * The status alone cannot separate these from ordinary back-pressure, so the body
29200
29238
  * is read rather than trusted: a 429 whose text names a spent balance is a verdict,
29201
29239
  * and retrying it only delays the message the user needs to see.
29240
+ *
29241
+ * Matched against the RAW body, not the one field summarizeFailureBody unwraps.
29242
+ * That extractor picks a single key, and the two envelopes this line documents put
29243
+ * the verdict in different places — `errorReason` on one, `base_resp.status_msg` on
29244
+ * the other — so a body whose chosen field says "rate limit" while its sibling says
29245
+ * 额度不足 must still be read as the quota verdict it is. Same reasoning, same raw-text
29246
+ * match, as the sibling line's plan-scope test (kimi-code/adapter.ts:838).
29202
29247
  */
29203
29248
  const QUOTA_EXHAUSTED_PATTERNS = [
29204
- /insufficient/i,
29205
- /balance/i,
29206
- /quota/i,
29249
+ /insufficient\s+(?:balance|quota|credit|funds)/i,
29250
+ /(?:balance|credit)\s+(?:is\s+)?(?:exhausted|depleted|insufficient|not\s+enough)/i,
29251
+ /quota\s+(?:is\s+)?(?:exhausted|depleted|used\s*up|run\s*out)/i,
29252
+ /exceeded\s+(?:your\s+)?(?:current\s+)?(?:quota|balance|credit|token|usage)/i,
29253
+ /exceeded_current_quota_error/i,
29254
+ /account\s+balance/i,
29207
29255
  /arrears/i,
29208
29256
  /recharge/i,
29209
- /exceeded/i
29257
+ /(?:余额|额度|配额)[^,。;;]{0,4}?(?:不足|不够|耗尽|用尽|用完|已用光)/u,
29258
+ /(?:请|需|需要|立即|尽快)[^,。;;]{0,4}?(?:充值|续费|购买套餐|购买额度)/u,
29259
+ /欠费/u,
29260
+ /(?:超出|超过)[^,。;;]{0,6}?(?:额度|配额|余额)/u
29210
29261
  ];
29211
29262
  function matchesAny(text, patterns) {
29212
29263
  return patterns.some((pattern) => pattern.test(text));
29213
29264
  }
29214
29265
  /**
29266
+ * Whether this refusal is a spent window rather than a refused credential.
29267
+ *
29268
+ * The same raw-body match classifyMinimaxFailure performs, hoisted into its own name
29269
+ * because it now answers a second question too, and one the status alone cannot: is
29270
+ * renewing this credential worth attempting at all (see the recovery loop in this
29271
+ * adapter). A verdict the pool acts on and a verdict the user is shown have to be the
29272
+ * SAME verdict, so both read this one predicate against the same table rather than
29273
+ * keeping two copies of the condition that could drift apart.
29274
+ *
29275
+ * The status is inside on purpose. 403 is the only status a spent window arrives as,
29276
+ * and that outer test is what keeps a 401 the credential however its body happens to
29277
+ * read — on this route the service answers code 401 with the same sentence both
29278
+ * when no credential was sent and when one was refused, so reading quota wording
29279
+ * into it would send a working token off to be renewed.
29280
+ */
29281
+ function isSpentWindow403(status, bodyText) {
29282
+ return status === 403 && matchesAny(bodyText, QUOTA_EXHAUSTED_PATTERNS);
29283
+ }
29284
+ /**
29285
+ * The verdict a spent Token Plan window gets, whichever status carries it.
29286
+ *
29287
+ * One classification for both statuses on purpose. The condition is the same and so
29288
+ * is the remedy — this account's own window is gone until it resets — so a caller
29289
+ * that branched on the status would have to duplicate this sentence, and the two
29290
+ * copies would drift. Which status the service happened to use stays visible to the
29291
+ * user through the LlmError it is thrown with.
29292
+ */
29293
+ function quotaExhaustedFailure(detail) {
29294
+ return {
29295
+ code: "PROVIDER_ERROR",
29296
+ retryable: false,
29297
+ accountScoped: true,
29298
+ message: "MiniMax Code(编程订阅) reports the account quota is exhausted: " + (detail === "" ? "no remaining quota" : detail) + ". Top up or wait for the window to reset."
29299
+ };
29300
+ }
29301
+ /**
29215
29302
  * Classify one non-2xx response for the retry policy.
29216
29303
  *
29217
29304
  * A 401 on this route is the one failure with an unambiguous remedy, and it is the
@@ -29225,38 +29312,41 @@ function classifyMinimaxFailure(status, bodyText) {
29225
29312
  if (isHttpContextOverflow(status, bodyText)) return {
29226
29313
  code: CONTEXT_OVERFLOW_CODE,
29227
29314
  retryable: false,
29315
+ accountScoped: false,
29228
29316
  message: `${PROVIDER_NAME$2} context window exceeded: ${detail}`
29229
29317
  };
29318
+ if (isSpentWindow403(status, bodyText)) return quotaExhaustedFailure(detail);
29230
29319
  if (status === 401 || status === 403) return {
29231
29320
  code: "INVALID_CREDENTIAL",
29232
29321
  retryable: false,
29322
+ accountScoped: true,
29233
29323
  message: "MiniMax Code(编程订阅) rejected the stored credential (" + status + "). Sign in again in the MiniMax Code app, then reopen this card." + (detail === "" ? "" : " " + detail)
29234
29324
  };
29235
29325
  if (status === 429) {
29236
- if (matchesAny(detail, QUOTA_EXHAUSTED_PATTERNS)) return {
29237
- code: "PROVIDER_ERROR",
29238
- retryable: false,
29239
- message: "MiniMax Code(编程订阅) reports the account quota is exhausted: " + (detail === "" ? "no remaining quota" : detail) + ". Top up or wait for the window to reset."
29240
- };
29326
+ if (matchesAny(bodyText, QUOTA_EXHAUSTED_PATTERNS)) return quotaExhaustedFailure(detail);
29241
29327
  return {
29242
29328
  code: "RATE_LIMIT",
29243
29329
  retryable: true,
29330
+ accountScoped: false,
29244
29331
  message: "MiniMax Code(编程订阅) is rate limited or overloaded (429): " + (detail === "" ? "too many requests" : detail) + ". Retrying with backoff."
29245
29332
  };
29246
29333
  }
29247
29334
  if (status >= 500) return {
29248
29335
  code: "SERVER",
29249
29336
  retryable: true,
29337
+ accountScoped: false,
29250
29338
  message: "MiniMax Code(编程订阅) upstream server error (" + status + "): " + (detail === "" ? "the model provider is temporarily unavailable" : detail) + ". Retrying with backoff."
29251
29339
  };
29252
29340
  if (status === 400) return {
29253
29341
  code: "PROVIDER_ERROR",
29254
29342
  retryable: false,
29343
+ accountScoped: false,
29255
29344
  message: "MiniMax Code(编程订阅) rejected the request (400): " + (detail === "" ? "the request was not accepted" : detail)
29256
29345
  };
29257
29346
  return {
29258
29347
  code: "PROVIDER_ERROR",
29259
29348
  retryable: false,
29349
+ accountScoped: false,
29260
29350
  message: "MiniMax Code(编程订阅) API error (" + status + "): " + (detail === "" ? "No response" : detail)
29261
29351
  };
29262
29352
  }
@@ -29448,10 +29538,10 @@ var MinimaxCodeAdapter = class extends LlmAdapter {
29448
29538
  * Without a pool the previous behaviour is kept exactly, including the
29449
29539
  * read-only-first refresh policy.
29450
29540
  */
29451
- async acquireCredential(fetchFn, signal) {
29541
+ async acquireCredential(fetchFn, signal, excludeAccountIds) {
29452
29542
  const pool = this.options.accountPool;
29453
29543
  if (pool !== void 0) {
29454
- const effective = await pool.getEffectiveCredential(void 0, fetchFn);
29544
+ const effective = await pool.getEffectiveCredential(excludeAccountIds, fetchFn);
29455
29545
  return {
29456
29546
  credentials: effective.credentials,
29457
29547
  accountId: effective.account.id
@@ -29578,63 +29668,78 @@ var MinimaxCodeAdapter = class extends LlmAdapter {
29578
29668
  const contextWindow = contextWindowForModel(options.model, settings.contextWindowOverrides);
29579
29669
  const requestOptions = offloadOldestRequestVideos(offloadOldestRequestImages$2(normalizeGenerateOptions(options), maxRequestImageBytes()), MAX_REQUEST_VIDEO_BYTES);
29580
29670
  const [images, videos] = await Promise.all([resolveRequestImages$2(requestOptions, this.options.attachments, signal), resolveRequestVideos(requestOptions, this.options.videos, signal)]);
29671
+ const effectiveMax = clampOutputToContext(floorForcedThinkingTokens(options.model, requestOptions.maxTokens) ?? maxOutputTokensFor$1(options.model, contextWindow), contextWindow, estimatedInputTokens(requestOptions));
29672
+ const tried = /* @__PURE__ */ new Set();
29581
29673
  let credentials;
29674
+ let authOwner;
29582
29675
  let accountId;
29583
- try {
29584
- const selection = await this.acquireCredential(fetchFn, signal);
29585
- credentials = selection.credentials;
29586
- accountId = selection.accountId;
29587
- } catch (error) {
29588
- if (error instanceof MinimaxCodeUnauthorizedError) throw new LlmError(error.message, "INVALID_CREDENTIAL", { cause: error });
29589
- throw new LlmError("MiniMax Code(编程订阅) credential could not be prepared: " + (error instanceof Error ? error.message : String(error)), "MISSING_CREDENTIAL", { cause: error });
29590
- }
29591
- let authOwner = computeMinimaxAuthOwner(credentials, accountId);
29592
- const withUploads = await uploadOversizedMedia(requestOptions, images, videos, credentials, accountId, this.options.fetchFn ?? fetch, signal);
29593
- const effectiveMax = clampOutputToContext(floorForcedThinkingTokens(options.model, requestOptions.maxTokens) ?? maxOutputTokensFor$1(options.model, contextWindow), contextWindow, estimatedInputTokens(requestOptions));
29594
- const buildBodyForOwner = (owner) => {
29595
- return assertRequestBodyFits(buildMinimaxRequest({
29596
- ...withUploads,
29597
- maxTokens: effectiveMax
29598
- }, images, {
29599
- cacheControl: true,
29600
- videos,
29601
- videoAccepted: minimaxCodeModelDef(options.model)?.inputModalities.includes("video") === true,
29602
- authOwner: owner,
29603
- route: PROVIDER_ID$2
29604
- }));
29605
- };
29606
- let body = buildBodyForOwner(authOwner);
29607
29676
  let response;
29608
- for (let attempt = 0;; attempt += 1) {
29609
- try {
29610
- response = await fetchWithContextBudgetRecovery(fetchFn)(messagesUrl(credentials.region), {
29611
- method: "POST",
29612
- headers: modelRequestHeaders(credentials.accessToken),
29613
- body,
29614
- signal
29615
- });
29616
- } catch (error) {
29617
- if (signal.aborted) throw new LlmError("MiniMax Code request aborted", "ABORTED", { cause: error });
29618
- throw new LlmError("MiniMax Code(编程订阅) request failed: " + (error instanceof Error ? error.message : String(error)), "TRANSPORT", { cause: error });
29619
- }
29620
- if (response.ok) break;
29621
- if (attempt > 0 || response.status !== 401 && response.status !== 403) break;
29622
- await response.text().catch(() => "");
29623
- const refused = credentials.accessToken;
29677
+ const pool = this.options.accountPool;
29678
+ while (true) {
29624
29679
  try {
29625
- credentials = await this.renewCredential(accountId, fetchFn, signal, refused);
29626
- authOwner = computeMinimaxAuthOwner(credentials, accountId);
29627
- body = buildBodyForOwner(authOwner);
29680
+ const selection = await this.acquireCredential(fetchFn, signal, pool === void 0 ? void 0 : tried);
29681
+ credentials = selection.credentials;
29682
+ accountId = selection.accountId;
29628
29683
  } catch (error) {
29629
29684
  if (error instanceof MinimaxCodeUnauthorizedError) throw new LlmError(error.message, "INVALID_CREDENTIAL", { cause: error });
29630
- throw new LlmError("MiniMax Code(编程订阅) credential could not be renewed after the service refused " + redactToken(refused) + ": " + (error instanceof Error ? error.message : String(error)), "INVALID_CREDENTIAL", { cause: error });
29685
+ throw new LlmError("MiniMax Code(编程订阅) credential could not be prepared: " + (error instanceof Error ? error.message : String(error)), "MISSING_CREDENTIAL", { cause: error });
29686
+ }
29687
+ if (accountId !== void 0) tried.add(accountId);
29688
+ authOwner = computeMinimaxAuthOwner(credentials, accountId);
29689
+ const withUploads = await uploadOversizedMedia(requestOptions, images, videos, credentials, accountId, this.options.fetchFn ?? fetch, signal);
29690
+ const buildBodyForOwner = (owner) => {
29691
+ return assertRequestBodyFits(buildMinimaxRequest({
29692
+ ...withUploads,
29693
+ maxTokens: effectiveMax
29694
+ }, images, {
29695
+ cacheControl: true,
29696
+ videos,
29697
+ videoAccepted: minimaxCodeModelDef(options.model)?.inputModalities.includes("video") === true,
29698
+ authOwner: owner,
29699
+ route: PROVIDER_ID$2
29700
+ }));
29701
+ };
29702
+ let body = buildBodyForOwner(authOwner);
29703
+ let refusedBody;
29704
+ for (let attempt = 0;; attempt += 1) {
29705
+ try {
29706
+ response = await fetchWithContextBudgetRecovery(fetchFn)(messagesUrl(credentials.region), {
29707
+ method: "POST",
29708
+ headers: modelRequestHeaders(credentials.accessToken),
29709
+ body,
29710
+ signal
29711
+ });
29712
+ } catch (error) {
29713
+ if (signal.aborted) throw new LlmError("MiniMax Code request aborted", "ABORTED", { cause: error });
29714
+ throw new LlmError("MiniMax Code(编程订阅) request failed: " + (error instanceof Error ? error.message : String(error)), "TRANSPORT", { cause: error });
29715
+ }
29716
+ refusedBody = void 0;
29717
+ if (response.ok) break;
29718
+ if (attempt > 0 || response.status !== 401 && response.status !== 403) break;
29719
+ refusedBody = await response.text().catch(() => "");
29720
+ if (pool !== void 0 && accountId !== void 0 && isSpentWindow403(response.status, refusedBody)) break;
29721
+ const refused = credentials.accessToken;
29722
+ try {
29723
+ credentials = await this.renewCredential(accountId, fetchFn, signal, refused);
29724
+ authOwner = computeMinimaxAuthOwner(credentials, accountId);
29725
+ body = buildBodyForOwner(authOwner);
29726
+ } catch (error) {
29727
+ if (error instanceof MinimaxCodeUnauthorizedError) throw new LlmError(error.message, "INVALID_CREDENTIAL", { cause: error });
29728
+ throw new LlmError("MiniMax Code(编程订阅) credential could not be renewed after the service refused " + redactToken(refused) + ": " + (error instanceof Error ? error.message : String(error)), "INVALID_CREDENTIAL", { cause: error });
29729
+ }
29631
29730
  }
29632
- }
29633
- if (!response.ok) {
29634
- const detail = (await response.text().catch(() => "")).slice(0, 2e3);
29731
+ if (response.ok) break;
29732
+ const detail = (refusedBody ?? await response.text().catch(() => "")).slice(0, 2e3);
29635
29733
  const failure = classifyMinimaxFailure(response.status, detail);
29636
29734
  const after = response.status === 429 ? retryAfterMs$1(response.headers) : void 0;
29637
- const hint = response.status === 401 || response.status === 403 ? " (credential " + redactToken(credentials.accessToken) + ")" : "";
29735
+ if (pool !== void 0 && accountId !== void 0) {
29736
+ const spentWindow = failure.accountScoped && failure.code !== "INVALID_CREDENTIAL";
29737
+ if (response.status === 429 || response.status === 403 && spentWindow) {
29738
+ await pool.markCooldown(accountId, failure.accountScoped ? quotaCooldownMs(detail) : after ?? POOL_COOLDOWN_MS$2, PROVIDER_NAME$2 + (response.status === 429 ? " 429" : " 403")).catch(() => void 0);
29739
+ if (await pool.hasAnotherAvailableAccount(tried)) continue;
29740
+ }
29741
+ }
29742
+ const hint = failure.code === "INVALID_CREDENTIAL" ? " (credential " + redactToken(credentials.accessToken) + ")" : "";
29638
29743
  throw new LlmError(failure.message + hint, failure.code, {
29639
29744
  status: response.status,
29640
29745
  ...after === void 0 ? {} : { providerRetryAfterMs: after }
@@ -29687,7 +29792,18 @@ var MinimaxCodeAdapter = class extends LlmAdapter {
29687
29792
  yield chunk;
29688
29793
  }
29689
29794
  } catch (error) {
29690
- if (error instanceof LlmError && !outputStarted && error.code === "PROVIDER_ERROR" && state.streamError !== void 0) throw reclassifyInBandError(error, state.streamError, classifyMinimaxFailure);
29795
+ if (error instanceof LlmError && !outputStarted && error.code === "PROVIDER_ERROR" && state.streamError !== void 0) {
29796
+ const reclassified = reclassifyInBandError(error, state.streamError, classifyMinimaxFailure);
29797
+ if (pool !== void 0 && accountId !== void 0) {
29798
+ const inBandBody = JSON.stringify({ error: state.streamError });
29799
+ const status = inBandAnthropicStatus(state.streamError);
29800
+ if (status === 429) {
29801
+ const failure = classifyMinimaxFailure(status, inBandBody);
29802
+ await pool.markCooldown(accountId, failure.accountScoped ? quotaCooldownMs(inBandBody) : POOL_COOLDOWN_MS$2, "MiniMax Code(编程订阅) in-stream 429").catch(() => void 0);
29803
+ }
29804
+ }
29805
+ throw reclassified;
29806
+ }
29691
29807
  throw error;
29692
29808
  }
29693
29809
  } finally {
@@ -48,6 +48,17 @@ export interface MinimaxFailureClassification {
48
48
  message: string;
49
49
  /** True only when the failure is worth retrying. */
50
50
  retryable: boolean;
51
+ /**
52
+ * Whether the verdict is about the ACCOUNT that made the request.
53
+ *
54
+ * False for every failure that belongs to the request or to the plan: ordinary
55
+ * back-pressure, an overload, a malformed body. True only for a Token Plan window
56
+ * this account has spent, which stays spent — so cooling it is what lets the NEXT
57
+ * request land on an account that can answer, and cooling a plan-scoped refusal
58
+ * would take a whole pool offline over one request. Same rule and same field name
59
+ * as the sibling lines' `accountScoped` (kimi-code/adapter.ts:246).
60
+ */
61
+ accountScoped: boolean;
51
62
  }
52
63
  /**
53
64
  * Classify one non-2xx response for the retry policy.
@@ -1 +1 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AAC,EAAE,OAAO,CAAA;IACf;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAA;IAC9D;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACtC,GACL,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA2GlC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,sBAAsB,GAAG,IAAI,GAAG,kBAAkB,GAAG,IAAI,CAEzG;AAED,OAAO,EAAE,4BAA4B,EAAE,YAAY,EAAE,aAAa,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAA;AAC1I,YAAY,EAAE,iBAAiB,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eddyskywalker/dsh-chatgpt-subscription",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "description": "DSH provider plugin for Codex access through a ChatGPT subscription.",
5
5
  "author": {
6
6
  "name": "eddyskywalker",