Refactor Codex Lens config handling and CLI tools status checks

- Updated Codex Lens config handler to extract embeddings data from the new response structure, including coverage percentage and total files with embeddings.
- Enhanced CLI tools status function to handle different tool types (builtin, cli-wrapper, api-endpoint) with improved logic for checking availability based on configuration.
- Removed obsolete test files and directories that are no longer needed.
This commit is contained in:
catlog22
2026-01-12 22:49:30 +08:00
parent 5259bf48b2
commit 908a745f95
6 changed files with 75 additions and 1861 deletions

View File

@@ -170,9 +170,13 @@ export async function handleCodexLensConfigRoutes(ctx: RouteContext): Promise<bo
const indexedFiles = projectData.total_files || 0; // All indexed files have FTS
// Get embeddings data from index status
const filesWithEmbeddings = embeddingsData?.files_with_embeddings || 0;
// The response structure is: { total_indexes, indexes_with_embeddings, total_chunks, indexes: [{coverage_percent, total_files, ...}] }
const indexesWithEmbeddings = embeddingsData?.indexes_with_embeddings || 0;
const totalChunks = embeddingsData?.total_chunks || 0;
const vectorPercent = embeddingsData?.coverage_percent || 0;
// coverage_percent is in the indexes array - get the first one (for single project query)
const indexEntry = embeddingsData?.indexes?.[0];
const vectorPercent = indexEntry?.coverage_percent || 0;
const filesWithEmbeddings = indexEntry?.total_files || 0;
// FTS percentage (all indexed files have FTS, so it's always 100% if indexed)
const ftsPercent = totalFiles > 0 ? 100 : 0;