From 89b34755087eff72dd2c9c683da3d3af255c700a Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sun, 21 Dec 2025 11:02:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20CodexLens=20?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=A4=84=E7=90=86=EF=BC=8C=E4=BF=9D=E6=8C=81?= =?UTF-8?q?=E6=80=BB=E5=A4=A7=E5=B0=8F=E4=B8=80=E8=87=B4=E6=80=A7=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=8C=E6=95=B4=E7=B4=A2=E5=BC=95=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ccw/src/core/routes/codexlens-routes.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ccw/src/core/routes/codexlens-routes.ts b/ccw/src/core/routes/codexlens-routes.ts index 012f7f14..49e723e1 100644 --- a/ccw/src/core/routes/codexlens-routes.ts +++ b/ccw/src/core/routes/codexlens-routes.ts @@ -195,14 +195,15 @@ export async function handleCodexLensRoutes(ctx: RouteContext): Promise totalProjects: status.result.projects_count || indexes.length, totalFiles: status.result.total_files || 0, totalDirs: status.result.total_dirs || 0, - indexSizeBytes: status.result.index_size_bytes || totalSize, - indexSizeMb: status.result.index_size_mb || 0, - embeddings: status.result.embeddings || {} + // Keep calculated totalSize for consistency with per-project sizes + // status.index_size_bytes includes shared resources (models, cache) + indexSizeBytes: totalSize, + indexSizeMb: totalSize / (1024 * 1024), + embeddings: status.result.embeddings || {}, + // Store full index dir size separately for reference + fullIndexDirSize: status.result.index_size_bytes || 0, + fullIndexDirSizeFormatted: formatSize(status.result.index_size_bytes || 0) }; - // Use status total size if available - if (status.result.index_size_bytes) { - totalSize = status.result.index_size_bytes; - } } } catch (e) { console.error('[CodexLens] Failed to parse status:', e.message);