qwenproxy-cli 1.0.27 → 1.0.28

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": "qwenproxy-cli",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "High-performance OpenAI & Anthropic compatible API gateway for Qwen with multi-account rotation, interactive TUI, and resilient tool calling.",
5
5
  "main": "src/index.ts",
6
6
  "bin": {
@@ -101,7 +101,7 @@ export function clearAllAccountCooldowns(): number {
101
101
  count++;
102
102
  }
103
103
  }
104
- cooldowns.delete("global");
104
+ cooldowns.clear();
105
105
  return count;
106
106
  }
107
107
 
@@ -29,7 +29,7 @@ export function recordServerLog(level: "INFO" | "WARN" | "ERROR", text: string):
29
29
 
30
30
  const lines = clean.split(/\r?\n/);
31
31
  for (const raw of lines) {
32
- const line = raw.trim();
32
+ let line = raw.trim();
33
33
  if (!line) continue;
34
34
  // Filter out raw ASCII box frames and border rows
35
35
  if (/^[+\-=#]{5,}$/.test(line)) continue;
@@ -49,6 +49,12 @@ export function recordServerLog(level: "INFO" | "WARN" | "ERROR", text: string):
49
49
  continue;
50
50
  }
51
51
 
52
+ // Clean redundant leading level tags (e.g. "WARN [Qwen]" -> "[Qwen]")
53
+ // and normalize multi-space gaps after emojis
54
+ line = line
55
+ .replace(/^(?:\[?(?:INFO|WARN|WARNING|ERROR|ERR|DEBUG)\]?\s+)+/i, "")
56
+ .replace(/([\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}\u{2300}-\u{23FF}]\uFE0F?)\s{2,}/gu, "$1 ");
57
+ if (!line) continue;
52
58
  const entry: ServerLogMessage = { time, level, message: line };
53
59
  logHistory.push(entry);
54
60
  if (logHistory.length > MAX_LOG_HISTORY) {
@@ -116,7 +116,7 @@ export function logMediaDebug(message: string): void {
116
116
  }
117
117
 
118
118
  export function logMediaWarn(message: string): void {
119
- console.warn(`⚠️ ${message}`);
119
+ console.warn(`⚠️ ${message}`);
120
120
  }
121
121
 
122
122
  export function logMediaError(message: string): void {
@@ -658,7 +658,7 @@ async function requestCompletionsWithBrowserFallback(params: {
658
658
  headers,
659
659
  referrer: qwenUrl(`/c/${encodeURIComponent(chatId)}`),
660
660
  streaming,
661
- timeoutMs: Math.min(timeoutMs, IMAGE_TIMEOUT_MS),
661
+ timeoutMs: Math.min(timeoutMs, kind === "video" ? VIDEO_TIMEOUT_MS : IMAGE_TIMEOUT_MS),
662
662
  });
663
663
 
664
664
  if (browserResult.error) {
@@ -2676,7 +2676,10 @@ export async function withAccountPage<T>(
2676
2676
  return result;
2677
2677
  } catch (error) {
2678
2678
  const message = getErrorMessage(error);
2679
- if (message.includes("Playwright page operation timed out")) {
2679
+ if (
2680
+ recoverOnTimeout &&
2681
+ message.includes("Playwright page operation timed out")
2682
+ ) {
2680
2683
  console.warn(
2681
2684
  `⏱️ [Playwright] Resetting account context after a stuck page operation: ${accountId}`,
2682
2685
  );
@@ -113,6 +113,11 @@ export class ServerManager {
113
113
  ) {
114
114
  continue;
115
115
  }
116
+ // Clean redundant leading level tags (e.g. "WARN [Qwen]" -> "[Qwen]")
117
+ // and normalize multi-space gaps after emojis
118
+ line = line
119
+ .replace(/^(?:\[?(?:INFO|WARN|WARNING|ERROR|ERR|DEBUG)\]?\s+)+/i, "")
120
+ .replace(/([\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}\u{2300}-\u{23FF}]\uFE0F?)\s{2,}/gu, "$1 ");
116
121
  if (!line) continue;
117
122
 
118
123
  // Prevent identical consecutive duplicate logs in the same second