From 08099cdcb91426b80040d98459234fa041f2f420 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Tue, 6 Jan 2026 08:56:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20Python=20=E5=86=B7?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=B6=85=E6=97=B6=E8=87=B3=2015=20=E7=A7=92?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=92=8C=E9=85=8D=E7=BD=AE=E7=9A=84=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ccw/src/tools/litellm-client.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ccw/src/tools/litellm-client.ts b/ccw/src/tools/litellm-client.ts index 24cdc4b9..8c7a1050 100644 --- a/ccw/src/tools/litellm-client.ts +++ b/ccw/src/tools/litellm-client.ts @@ -114,7 +114,8 @@ export class LiteLLMClient { */ async isAvailable(): Promise { try { - await this.executePython(['version'], { timeout: 5000 }); + // Increased timeout to 15s for Python cold start + await this.executePython(['version'], { timeout: 15000 }); return true; } catch { return false; @@ -126,10 +127,14 @@ export class LiteLLMClient { */ async getStatus(): Promise { try { - const output = await this.executePython(['version'], { timeout: 5000 }); + // Increased timeout to 15s for Python cold start + const output = await this.executePython(['version'], { timeout: 15000 }); + // Parse "ccw-litellm 0.1.0" format + const versionMatch = output.trim().match(/ccw-litellm\s+([\d.]+)/); + const version = versionMatch ? versionMatch[1] : output.trim(); return { available: true, - version: output.trim() + version }; } catch (error: any) { return { @@ -143,7 +148,8 @@ export class LiteLLMClient { * Get current configuration */ async getConfig(): Promise { - const output = await this.executePython(['config', '--json']); + // config command outputs JSON by default, no --json flag needed + const output = await this.executePython(['config']); return JSON.parse(output); }