mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-22 19:18:47 +08:00
Remove outdated tests for CodexLens and LiteLLM client, refactor Smart Search MCP usage tests to use new command structure, and clean up unified vector index tests.
This commit is contained in:
@@ -3,7 +3,6 @@ import { URL } from 'url';
|
||||
import { getCoreMemoryStore } from '../core-memory-store.js';
|
||||
import type { CoreMemory, SessionCluster, ClusterMember, ClusterRelation } from '../core-memory-store.js';
|
||||
import { getEmbeddingStatus, generateEmbeddings } from '../memory-embedder-bridge.js';
|
||||
import { checkSemanticStatus } from '../../tools/codex-lens.js';
|
||||
import { MemoryJobScheduler } from '../memory-job-scheduler.js';
|
||||
import type { JobStatus } from '../memory-job-scheduler.js';
|
||||
import { StoragePaths } from '../../config/storage-paths.js';
|
||||
@@ -781,8 +780,8 @@ export async function handleCoreMemoryRoutes(ctx: RouteContext): Promise<boolean
|
||||
const projectPath = url.searchParams.get('path') || initialPath;
|
||||
|
||||
try {
|
||||
// Check semantic status using CodexLens's check (same as status page)
|
||||
const semanticStatus = await checkSemanticStatus();
|
||||
// Semantic status: codexlens v1 removed, always unavailable via this path
|
||||
const semanticStatus = { available: false, error: 'Use codexlens MCP server instead' };
|
||||
|
||||
if (!semanticStatus.available) {
|
||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||
@@ -825,8 +824,7 @@ export async function handleCoreMemoryRoutes(ctx: RouteContext): Promise<boolean
|
||||
const basePath = projectPath || initialPath;
|
||||
|
||||
try {
|
||||
// Check semantic status using CodexLens's check
|
||||
const semanticStatus = await checkSemanticStatus();
|
||||
const semanticStatus = { available: false, error: 'Use codexlens MCP server instead' };
|
||||
if (!semanticStatus.available) {
|
||||
return { error: semanticStatus.error || 'Semantic search not available. Install it from CLI > CodexLens > Semantic page.', status: 503 };
|
||||
}
|
||||
|
||||
@@ -1084,7 +1084,35 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
* Handle MCP routes
|
||||
* @returns true if route was handled, false otherwise
|
||||
*/
|
||||
// Seed built-in MCP templates once
|
||||
let _templateSeeded = false;
|
||||
function seedBuiltinTemplates(): void {
|
||||
if (_templateSeeded) return;
|
||||
_templateSeeded = true;
|
||||
try {
|
||||
McpTemplatesDb.saveTemplate({
|
||||
name: 'codexlens',
|
||||
description: 'CodexLens semantic code search (vector + FTS + reranking)',
|
||||
serverConfig: {
|
||||
command: 'uvx',
|
||||
args: ['--from', 'codexlens-search[mcp]', 'codexlens-mcp'],
|
||||
env: {
|
||||
CODEXLENS_EMBED_API_URL: '',
|
||||
CODEXLENS_EMBED_API_KEY: '',
|
||||
CODEXLENS_EMBED_API_MODEL: 'text-embedding-3-small',
|
||||
CODEXLENS_EMBED_DIM: '1536',
|
||||
},
|
||||
},
|
||||
category: 'code-search',
|
||||
tags: ['search', 'semantic', 'code-intelligence'],
|
||||
});
|
||||
} catch {
|
||||
// Template may already exist — ignore upsert errors
|
||||
}
|
||||
}
|
||||
|
||||
export async function handleMcpRoutes(ctx: RouteContext): Promise<boolean> {
|
||||
seedBuiltinTemplates();
|
||||
const { pathname, url, req, res, initialPath, handlePostRequest, broadcastToClients } = ctx;
|
||||
|
||||
// API: Get MCP configuration (includes both Claude and Codex)
|
||||
@@ -1230,13 +1258,13 @@ export async function handleMcpRoutes(ctx: RouteContext): Promise<boolean> {
|
||||
const enabledToolsRaw = envInput.enabledTools;
|
||||
let enabledToolsEnv: string;
|
||||
if (enabledToolsRaw === undefined || enabledToolsRaw === null) {
|
||||
enabledToolsEnv = 'write_file,edit_file,read_file,core_memory,ask_question,smart_search';
|
||||
enabledToolsEnv = 'write_file,edit_file,read_file,core_memory,ask_question';
|
||||
} else if (Array.isArray(enabledToolsRaw)) {
|
||||
enabledToolsEnv = enabledToolsRaw.filter((t): t is string => typeof t === 'string').join(',');
|
||||
} else if (typeof enabledToolsRaw === 'string') {
|
||||
enabledToolsEnv = enabledToolsRaw;
|
||||
} else {
|
||||
enabledToolsEnv = 'write_file,edit_file,read_file,core_memory,ask_question,smart_search';
|
||||
enabledToolsEnv = 'write_file,edit_file,read_file,core_memory,ask_question';
|
||||
}
|
||||
|
||||
const projectRoot = typeof envInput.projectRoot === 'string' ? envInput.projectRoot : undefined;
|
||||
|
||||
Reference in New Issue
Block a user