qwenproxy-cli 1.2.5 → 1.2.6
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.2.
|
|
3
|
+
"version": "1.2.6",
|
|
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": {
|
|
@@ -79,6 +79,13 @@ export function recordServerLog(level: "INFO" | "WARN" | "ERROR", text: string):
|
|
|
79
79
|
.replace(/^(?:\[?(?:INFO|WARN|WARNING|ERROR|ERR|DEBUG)\]?\s+)+/i, "")
|
|
80
80
|
.replace(/([\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}\u{2300}-\u{23FF}]\uFE0F?)\s{2,}/gu, "$1 ");
|
|
81
81
|
if (!line) continue;
|
|
82
|
+
|
|
83
|
+
// Prevent identical consecutive duplicate logs in the same second
|
|
84
|
+
const last = logHistory[logHistory.length - 1];
|
|
85
|
+
if (last && last.time === time && last.level === level && last.message === line) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
|
|
82
89
|
const entry: ServerLogMessage = { time, level, message: line };
|
|
83
90
|
logHistory.push(entry);
|
|
84
91
|
if (logHistory.length > MAX_LOG_HISTORY) {
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { config } from "../core/config.ts";
|
|
7
7
|
import { startServer, stopServer } from "../api/server.ts";
|
|
8
8
|
import { stripAnsi } from "./theme.ts";
|
|
9
|
-
import { recordServerLog } from "../core/server-log-buffer.ts";
|
|
10
9
|
|
|
11
10
|
export type ServerLifecycleState = "offline" | "warming" | "online" | "error";
|
|
12
11
|
export interface ServerLogEntry {
|
|
@@ -137,9 +136,6 @@ export class ServerManager {
|
|
|
137
136
|
if (this.logBuffer.length > 2000) {
|
|
138
137
|
this.logBuffer.shift();
|
|
139
138
|
}
|
|
140
|
-
try {
|
|
141
|
-
recordServerLog(level, line);
|
|
142
|
-
} catch {}
|
|
143
139
|
}
|
|
144
140
|
}
|
|
145
141
|
public interceptLogs(): void {
|
|
@@ -9,7 +9,7 @@ import type { KeyEvent } from "../screen.ts";
|
|
|
9
9
|
import { theme, drawBox, stringWidth, truncate, pad, stripAnsi, setClipboardText } from "../theme.ts";
|
|
10
10
|
import { ServerManager } from "../server-manager.ts";
|
|
11
11
|
import { loadTuiSettings, saveTuiSettings } from "../settings.ts";
|
|
12
|
-
import { getServerLogFilePath } from "../../core/paths.ts";
|
|
12
|
+
import { getServerLogFilePath, isRunningUnderNodeTest } from "../../core/paths.ts";
|
|
13
13
|
export class LogsView implements TuiView {
|
|
14
14
|
public readonly id = "logs";
|
|
15
15
|
public readonly title = "Logs";
|
|
@@ -471,7 +471,7 @@ export class LogsView implements TuiView {
|
|
|
471
471
|
text = `[${entry.time}] [${entry.level}] ${entry.message}`;
|
|
472
472
|
} else {
|
|
473
473
|
// For full copy of "all" filter, prefer the complete persistent file from disk if available
|
|
474
|
-
if (this.filter === "all") {
|
|
474
|
+
if (this.filter === "all" && !isRunningUnderNodeTest()) {
|
|
475
475
|
try {
|
|
476
476
|
const logPath = getServerLogFilePath();
|
|
477
477
|
if (fs.existsSync(logPath)) {
|