maxpool 1.24.19 → 1.24.20
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 +1 -1
- package/src/server.js +13 -1
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -507,7 +507,19 @@ async function forwardRequest(
|
|
|
507
507
|
ctx.account = '(none available)';
|
|
508
508
|
const retryPlan = accountManager.nextRetryForRequest?.(requestInfo, new Set()) || {};
|
|
509
509
|
const willRecoverSoon = Number.isFinite(retryPlan.retryAfterMs);
|
|
510
|
-
|
|
510
|
+
// CLI-RETRIABLE CAP (2026-10-11 "bricked sessions"). The real soonest reset can
|
|
511
|
+
// be hours out; sending `retry-after: 10800` makes Claude Code's SDK treat the
|
|
512
|
+
// 429 as terminal (binary-verified 2.1.296: a plain rate_limit 429 whose
|
|
513
|
+
// retry-after exceeds 60s + 25% headroom aborts with tengu_api_retry_after_too_long
|
|
514
|
+
// — it neither sleeps nor retries; the turn dies and the session looks dead).
|
|
515
|
+
// The pool has ALREADY decided not to hold this request, so the honest and
|
|
516
|
+
// useful header is "retry soon": every SDK retries ≤60s values with backoff,
|
|
517
|
+
// and the pool answers again immediately with a fresh estimate. The body text
|
|
518
|
+
// still carries the real wait.
|
|
519
|
+
const RETRY_AFTER_RETRIABLE_S = 60;
|
|
520
|
+
const retryAfter = willRecoverSoon
|
|
521
|
+
? Math.min(Math.max(1, Math.ceil(retryPlan.retryAfterMs / 1000)), RETRY_AFTER_RETRIABLE_S)
|
|
522
|
+
: 60;
|
|
511
523
|
// Surface the routing decision (logs go to the TUI; this is the only record
|
|
512
524
|
// of WHY a request was rejected rather than queued).
|
|
513
525
|
console.log(`[Maxpool] No route for request — returning 429 (cause: ${retryPlan.cause || 'unavailable'}, recovers-soon: ${willRecoverSoon})`);
|