feat: 更新 CodexLens 工作区状态 API,支持通过查询参数指定项目路径

This commit is contained in:
catlog22
2026-01-12 21:00:50 +08:00
parent 76e1f855f1
commit 5282551277
2 changed files with 7 additions and 4 deletions

View File

@@ -110,8 +110,11 @@ export async function handleCodexLensConfigRoutes(ctx: RouteContext): Promise<bo
return true;
}
// Use path from query param, fallback to initialPath
const projectPath = url.searchParams.get('path') || initialPath;
// Get project info for current workspace
const projectResult = await executeCodexLens(['projects', 'get', initialPath, '--json']);
const projectResult = await executeCodexLens(['projects', 'get', projectPath, '--json']);
if (!projectResult.success) {
// No index for this workspace
@@ -163,7 +166,7 @@ export async function handleCodexLensConfigRoutes(ctx: RouteContext): Promise<bo
res.end(JSON.stringify({
success: true,
hasIndex: true,
path: initialPath,
path: projectPath,
fts: {
percent: ftsPercent,
indexedFiles,