maxpool 1.5.30 → 1.5.31

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": "maxpool",
3
- "version": "1.5.30",
3
+ "version": "1.5.31",
4
4
  "description": "Multi-account Claude Code proxy with adaptive, rate-aware load balancing across Claude accounts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/server.js CHANGED
@@ -123,7 +123,7 @@ export function createProxyServer(accountManager, config, hooks = {}) {
123
123
  if (req.method === 'POST' && req.url === '/v1/oauth/token') {
124
124
  const reqId = ++requestCounter;
125
125
  const ctx = { account: '(oauth relay)', status: null };
126
- const accepted = hooks.onRequestStart?.(reqId, { method: req.method, path: req.url });
126
+ const accepted = hooks.onRequestStart?.(reqId, { method: req.method, path: req.url, sessionKey: headerValue(req.headers, 'x-maxpool-session') });
127
127
  if (accepted === false) {
128
128
  res.writeHead(503, {
129
129
  'Content-Type': 'application/json',
@@ -156,7 +156,10 @@ export function createProxyServer(accountManager, config, hooks = {}) {
156
156
 
157
157
  // Track request
158
158
  const reqId = ++requestCounter;
159
- const accepted = hooks.onRequestStart?.(reqId, { method: req.method, path: req.url });
159
+ // sessionKey (from the per-terminal x-maxpool-session header) lets the TUI show
160
+ // how many distinct client sessions the in-flight requests span — so "N in-flight"
161
+ // isn't misread as "N sessions" (subagents of one terminal share one session key).
162
+ const accepted = hooks.onRequestStart?.(reqId, { method: req.method, path: req.url, sessionKey: headerValue(req.headers, 'x-maxpool-session') });
160
163
  if (accepted === false) {
161
164
  res.writeHead(503, {
162
165
  'Content-Type': 'application/json',
package/src/tui.js CHANGED
@@ -982,8 +982,15 @@ export class TUI {
982
982
 
983
983
  // ── Activity header
984
984
  lines.push('');
985
+ // "N active" reads as "N sessions" — but this is in-flight REQUESTS (Claude Code
986
+ // fans out many parallel subagent requests per session). Label it "in-flight" and
987
+ // show the distinct SESSION count (subagents of one terminal share one session key)
988
+ // so a busy 1-2 sessions firing dozens of requests isn't mistaken for a leak.
985
989
  const ac = this.active.size;
986
- const acTag = ac > 0 ? ` ${cyan(ac + ' active')}` : '';
990
+ const sessions = new Set([...this.active.values()].map(r => r.sessionKey).filter(Boolean)).size;
991
+ const acTag = ac > 0
992
+ ? ` ${cyan(ac + ' in-flight')}${sessions ? dim(` · ${sessions} session${sessions === 1 ? '' : 's'}`) : ''}`
993
+ : '';
987
994
  const aHdr = ` Activity${acTag} `;
988
995
  lines.push(aHdr + dim('─'.repeat(Math.max(1, W - vw(aHdr)))));
989
996