From e03822c9ce50e130b11e207c66e6310b364b9074 Mon Sep 17 00:00:00 2001 From: Alfreds Genkins <29531824+alfredsgenkins@users.noreply.github.com> Date: Fri, 27 Mar 2026 15:01:47 +0200 Subject: [PATCH 1/3] Enable indexing of config, infra, and style files by default Uncomment and extend the DEFAULT_SUPPORTED_EXTENSIONS list to include file types commonly found in real projects: YAML, JSON, SQL, CSS, HTML, shell scripts, Prisma schemas, GraphQL, Protobuf, Terraform, and Dockerfiles (by extension). Without these, Kubernetes manifests, CI/CD workflows, database migrations, and styling are invisible to semantic search. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/core/src/context.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/src/context.ts b/packages/core/src/context.ts index ff63371c..e3519eb6 100644 --- a/packages/core/src/context.ts +++ b/packages/core/src/context.ts @@ -29,8 +29,11 @@ const DEFAULT_SUPPORTED_EXTENSIONS = [ '.cs', '.go', '.rs', '.php', '.rb', '.swift', '.kt', '.scala', '.m', '.mm', // Text and markup files '.md', '.markdown', '.ipynb', - // '.txt', '.json', '.yaml', '.yml', '.xml', '.html', '.htm', - // '.css', '.scss', '.less', '.sql', '.sh', '.bash', '.env' + // Config, infrastructure, and supporting files + '.json', '.yaml', '.yml', '.xml', '.html', '.htm', '.toml', + '.css', '.scss', '.less', '.sql', '.sh', '.bash', + '.prisma', '.graphql', '.gql', '.proto', + '.dockerfile', '.tf', '.hcl', ]; const DEFAULT_IGNORE_PATTERNS = [ From b3be6bf322060a569cffc39d849091ff736b3f22 Mon Sep 17 00:00:00 2001 From: Alfreds Genkins <29531824+alfredsgenkins@users.noreply.github.com> Date: Fri, 27 Mar 2026 15:01:47 +0200 Subject: [PATCH 2/3] Fix DEADLINE_EXCEEDED gRPC timeout on Zilliz Serverless The default MilvusClient gRPC timeout (15s) is too short for Zilliz Serverless clusters, causing DEADLINE_EXCEEDED errors during indexing. Two changes: 1. Set MilvusClient timeout to 60s (configurable via MILVUS_TIMEOUT_MS) 2. Replace expensive dummy collection create/drop in checkCollectionLimit with a lightweight listCollections call Fixes #289 Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/core/src/vectordb/milvus-vectordb.ts | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/packages/core/src/vectordb/milvus-vectordb.ts b/packages/core/src/vectordb/milvus-vectordb.ts index 7396c9d6..8d706a4a 100644 --- a/packages/core/src/vectordb/milvus-vectordb.ts +++ b/packages/core/src/vectordb/milvus-vectordb.ts @@ -40,12 +40,14 @@ export class MilvusVectorDatabase implements VectorDatabase { private async initializeClient(address: string): Promise { const milvusConfig = this.config as MilvusConfig; console.log('🔌 Connecting to vector database at: ', address); + const timeoutMs = Number(process.env.MILVUS_TIMEOUT_MS) || 60000; this.client = new MilvusClient({ address: address, username: milvusConfig.username, password: milvusConfig.password, token: milvusConfig.token, ssl: milvusConfig.ssl || false, + timeout: timeoutMs, }); } @@ -742,42 +744,15 @@ export class MilvusVectorDatabase implements VectorDatabase { throw new Error('MilvusClient is not initialized. Call ensureInitialized() first.'); } - const collectionName = `dummy_collection_${Date.now()}`; - const createCollectionParams = { - collection_name: collectionName, - description: 'Test collection for limit check', - fields: [ - { - name: 'id', - data_type: DataType.VarChar, - max_length: 512, - is_primary_key: true, - }, - { - name: 'vector', - data_type: DataType.FloatVector, - dim: 128, - } - ] - }; - try { - await this.client.createCollection(createCollectionParams); - // Immediately drop the collection after successful creation - if (await this.client.hasCollection({ collection_name: collectionName })) { - await this.client.dropCollection({ - collection_name: collectionName, - }); - } - return true; + const response = await this.client.listCollections(); + const maxCollections = Number(process.env.MILVUS_MAX_COLLECTIONS) || 4; + return response.data.length < maxCollections; } catch (error: any) { - // Check if the error message contains the collection limit exceeded pattern const errorMessage = error.message || error.toString() || ''; if (/exceeded the limit number of collections/i.test(errorMessage)) { - // Return false for collection limit exceeded return false; } - // Re-throw other errors as-is throw error; } } From a8b3f045c117beef0aa7fa4089aa5ad9b10abbcf Mon Sep 17 00:00:00 2001 From: Alfreds Genkins <29531824+alfredsgenkins@users.noreply.github.com> Date: Fri, 27 Mar 2026 15:01:47 +0200 Subject: [PATCH 3/3] Support extension-less files (Dockerfile, Makefile, Jenkinsfile, etc.) Adds a DEFAULT_EXTENSIONLESS_FILENAMES set of well-known files that have no extension but should be indexed. When the file traversal encounters a file with no extension, it checks this set before skipping. Configurable via CUSTOM_EXTENSIONLESS_FILENAMES env var (comma-separated). Fixes #191 Co-Authored-By: Claude Sonnet 4.6 --- packages/core/src/context.ts | 48 ++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/packages/core/src/context.ts b/packages/core/src/context.ts index e3519eb6..e0f547df 100644 --- a/packages/core/src/context.ts +++ b/packages/core/src/context.ts @@ -36,6 +36,23 @@ const DEFAULT_SUPPORTED_EXTENSIONS = [ '.dockerfile', '.tf', '.hcl', ]; +/** + * Well-known extension-less filenames that should be indexed. + * Users can extend this via CUSTOM_EXTENSIONLESS_FILENAMES env var (comma-separated). + */ +const DEFAULT_EXTENSIONLESS_FILENAMES = new Set([ + 'Dockerfile', 'dockerfile', + 'Makefile', 'makefile', 'GNUmakefile', + 'Jenkinsfile', + 'Vagrantfile', + 'Gemfile', 'Rakefile', 'Guardfile', + 'Procfile', + 'Brewfile', + 'Caddyfile', + 'Fastfile', + 'Appfile', +]); + const DEFAULT_IGNORE_PATTERNS = [ // Common build output and dependency directories 'node_modules/**', @@ -105,6 +122,7 @@ export class Context { private codeSplitter: Splitter; private supportedExtensions: string[]; private ignorePatterns: string[]; + private extensionlessFilenames: Set; private synchronizers = new Map(); constructor(config: ContextConfig = {}) { @@ -148,7 +166,14 @@ export class Context { // Remove duplicates this.ignorePatterns = [...new Set(allIgnorePatterns)]; - console.log(`[Context] 🔧 Initialized with ${this.supportedExtensions.length} supported extensions and ${this.ignorePatterns.length} ignore patterns`); + // Build extensionless filename set from defaults + env + const envExtensionlessFilenames = this.getCustomExtensionlessFilenamesFromEnv(); + this.extensionlessFilenames = new Set([ + ...DEFAULT_EXTENSIONLESS_FILENAMES, + ...envExtensionlessFilenames, + ]); + + console.log(`[Context] 🔧 Initialized with ${this.supportedExtensions.length} supported extensions, ${this.extensionlessFilenames.size} extensionless filenames, and ${this.ignorePatterns.length} ignore patterns`); if (envCustomExtensions.length > 0) { console.log(`[Context] 📎 Loaded ${envCustomExtensions.length} custom extensions from environment: ${envCustomExtensions.join(', ')}`); } @@ -680,7 +705,11 @@ export class Context { await traverseDirectory(fullPath); } else if (entry.isFile()) { const ext = path.extname(entry.name); - if (this.supportedExtensions.includes(ext)) { + if (ext === '') { + if (this.extensionlessFilenames.has(entry.name)) { + files.push(fullPath); + } + } else if (this.supportedExtensions.includes(ext)) { files.push(fullPath); } } @@ -1161,6 +1190,21 @@ export class Context { } } + /** + * Get custom extensionless filenames from environment variables. + * Supports CUSTOM_EXTENSIONLESS_FILENAMES as comma-separated list (e.g. "Dockerfile,Makefile"). + */ + private getCustomExtensionlessFilenamesFromEnv(): string[] { + const envValue = envManager.get('CUSTOM_EXTENSIONLESS_FILENAMES'); + if (!envValue) return []; + try { + return envValue.split(',').map(f => f.trim()).filter(f => f.length > 0); + } catch (error) { + console.warn(`[Context] ⚠️ Failed to parse CUSTOM_EXTENSIONLESS_FILENAMES: ${error}`); + return []; + } + } + /** * Add custom extensions (from MCP or other sources) without replacing existing ones * @param customExtensions Array of custom extensions to add