maxpool 1.5.33 → 1.5.35
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/tui.js +25 -6
package/package.json
CHANGED
package/src/tui.js
CHANGED
|
@@ -318,7 +318,14 @@ export class TUI {
|
|
|
318
318
|
this.active.delete(id);
|
|
319
319
|
const dur = r ? ((Date.now() - r.started) / 1000).toFixed(1) : '?';
|
|
320
320
|
const acct = info.account || r?.account || '?';
|
|
321
|
-
|
|
321
|
+
// Tag PROVIDER-routed requests with the maxpool session id so provider traffic
|
|
322
|
+
// (when-exhausted overflow, or an incompatible-session pin) is traceable back to
|
|
323
|
+
// the session that caused it: grep the event log for `→ glm-fallback … [sess X]`,
|
|
324
|
+
// then `ps eww -p <pid> | grep x-maxpool-session` to find the terminal. Truthiness
|
|
325
|
+
// guard — a header-less request has sessionKey '' (server.js headerValue) → no tag.
|
|
326
|
+
const isProvider = this.am.accounts.find(a => a.name === acct)?.type === 'provider';
|
|
327
|
+
const tag = (isProvider && r?.sessionKey) ? ` [sess ${String(r.sessionKey).slice(0, 8)}]` : '';
|
|
328
|
+
this._addLog(`${info.method} ${info.path} → ${acct} (${info.status}, ${dur}s)${tag}`);
|
|
322
329
|
}
|
|
323
330
|
|
|
324
331
|
_addLog(msg) {
|
|
@@ -946,6 +953,15 @@ export class TUI {
|
|
|
946
953
|
const p = this.am._crossProviderFallbackPolicy?.() || 'when-exhausted';
|
|
947
954
|
const pc = p === 'never' ? yellow(p) : p === 'always' ? green(p) : cyan(p);
|
|
948
955
|
xpText = ` ${dim('·')} ${dim('Cross-provider:')} ${pc}`;
|
|
956
|
+
// Overflow visibility: when GLM/Kimi actually served requests recently, surface the
|
|
957
|
+
// volume so provider traffic isn't a mystery — it's overflow that spilled here while
|
|
958
|
+
// OAuth was saturated. Reuses the SAME 15m load window as the per-row "15m Nr" column.
|
|
959
|
+
const now = Date.now();
|
|
960
|
+
let provReq = 0;
|
|
961
|
+
for (const a of this.am.accounts) {
|
|
962
|
+
if (a.type === 'provider') provReq += this.am._loadSummary?.(a, 15 * 60_000, now)?.requests || 0;
|
|
963
|
+
}
|
|
964
|
+
if (provReq > 0) xpText += ` ${dim('·')} ${yellow(`providers: ${provReq} req/15m`)}`;
|
|
949
965
|
}
|
|
950
966
|
lines.push(` Routing ${cyan(routing)}${xpText}`);
|
|
951
967
|
const queuedCount = this.am.queueState?.waiting?.length || 0;
|
|
@@ -1040,13 +1056,16 @@ export class TUI {
|
|
|
1040
1056
|
|
|
1041
1057
|
_renderAcct(idx, bw, showBoth) {
|
|
1042
1058
|
const a = this.am.accounts[idx];
|
|
1043
|
-
// Highlight the
|
|
1044
|
-
//
|
|
1045
|
-
//
|
|
1046
|
-
//
|
|
1059
|
+
// Highlight the ACTIVE account(s) — drives BOTH the ► marker and the green
|
|
1060
|
+
// "active" status color. In manual mode that's the single pinned account (all
|
|
1061
|
+
// traffic goes there). In automatic load-balancing there is no single "current"
|
|
1062
|
+
// account, so mark every account SERVING a request right now (inFlight > 0) —
|
|
1063
|
+
// an honest live view of what's working. When idle, nothing is marked; a
|
|
1064
|
+
// throttled/idle provider is never falsely flagged (the old "most recently
|
|
1065
|
+
// routed to" currentIndex could land the marker on an idle fallback).
|
|
1047
1066
|
const isCur = this.am.routingMode === 'preferred'
|
|
1048
1067
|
? a.name === this.am.preferredAccountName
|
|
1049
|
-
:
|
|
1068
|
+
: a.inFlight > 0;
|
|
1050
1069
|
const isSel = this.mode === 'select' && idx === this.selIdx;
|
|
1051
1070
|
|
|
1052
1071
|
// Prefix: selection marker + current marker
|