Skip to content

feat(code-index): add Semble as a local on-the-fly embedding provider#399

Open
navedmerchant wants to merge 1 commit into
mainfrom
semble
Open

feat(code-index): add Semble as a local on-the-fly embedding provider#399
navedmerchant wants to merge 1 commit into
mainfrom
semble

Conversation

@navedmerchant
Copy link
Copy Markdown
Contributor

@navedmerchant navedmerchant commented May 29, 2026

Related GitHub Issue

Closes: #200

Description

This PR integrates [semble](https://pypi.org/project/semble/) as a new local embedding provider for code indexing. Semble performs hybrid semantic search on-the-fly — no API keys, no Qdrant instance, and no separate indexing step required.

How it works:

  • SembleCLI wraps the semble CLI using child_process.spawn with array arguments (no shell) to prevent injection. It handles search, find-related, version checking via pip show, and JSON output parsing for the v0.3.0+ response format.
  • SembleProvider implements the existing CodeIndex provider interface. On initialize() it checks that semble is installed and meets the >= 0.3.0 version requirement. Since semble indexes on-the-fly per search call, startIndexing() is a no-op that just marks the provider as ready.
  • CodeIndexManager detects embedderProvider === "semble" and delegates directly to SembleProvider, bypassing the ServiceFactory → orchestrator pipeline (which requires Qdrant). Guards were added to ServiceFactory to throw clearly if it's called for semble by mistake.
  • The CodeIndexPopover UI adds semble to the provider dropdown with a minimal config section (just an optional executable path field). Validation for semble skips the Qdrant URL and API key requirements that other providers need.

Key design choices:

  • Semble's "indexed on-the-fly" model means the status jumps directly to Indexed after install check — no progress bar needed.
  • File paths returned by semble are relative to the path it was invoked with, so results are resolved against searchPath (not workspacePath) to handle directoryPrefix correctly.
  • Version check uses pip show (falling back to pip3) rather than parsing --version output, which is more reliable across semble releases.

Test Procedure

Automated tests (run with pnpm test in the repo root):

  • src/services/code-index/semble/__tests__/semble-cli.spec.ts — unit tests for SembleCLI: spawn arg construction, shell injection safety, JSON parsing (v0.3.0+ format, empty results, error responses), version validation, pip fallback to pip3.
  • src/services/code-index/semble/__tests__/provider.spec.ts — unit tests for SembleProvider: initialization, state transitions, search delegation, result conversion, error handling.

Manual testing steps:

  1. Install semble: pip install semble (requires Python 3.10+)
  2. Open VS Code with this extension loaded (F5)
  3. Open the Code Index popover from the chat view
  4. Under Setup Config → Embedder Provider, select Semble - Local
  5. Leave the path as semble (or provide a full path if needed) and click Save
  6. Verify the status indicator transitions to Indexed and shows "Semble is ready. Searches index on-the-fly."
  7. Send a message that triggers a codebase search — confirm results are returned
  8. To test the error path: set the semble path to a non-existent binary, save, and verify the status shows Error with an install hint

To verify the no-semble error path without uninstalling:

  • Set codebaseIndexSemblePath to semble-does-not-exist in settings and confirm the error message appears.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes.
  • Documentation Impact: No documentation updates required for this PR — semble install instructions are surfaced inline in the settings UI.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Screenshot 2026-05-29 at 8 46 54 AM Screenshot 2026-05-29 at 8 47 16 AM

Additional Notes

  • findRelated is implemented in SembleCLI but not yet exposed through SembleProvider or CodeIndexManager. It's reserved for a future "find similar code" action.
  • Semble's on-disk cache lives at ~/Library/Caches/semble/ (macOS) or equivalent. clearIndexData() resets provider state but does not delete the cache — users can run semble clear-cache manually.

Summary by CodeRabbit

  • New Features

    • Added support for "semble" as a new local code search provider, enabling hybrid search without API keys.
    • Added configuration option to specify the semble executable path.
    • Added "openrouter" as a supported embedder provider.
  • Documentation

    • Added UI guidance and localization for semble setup and installation instructions.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

This PR adds Semble, a local hybrid code search tool, as a new embedder provider for code indexing. The implementation spans type definitions, configuration management, a CLI wrapper with process spawning, provider orchestration, manager integration, service guards, webview UI controls, and comprehensive test coverage.

Changes

Semble local indexing support

Layer / File(s) Summary
Type contracts and schemas
packages/types/src/codebase-index.ts, packages/types/src/embedding.ts, packages/types/src/vscode-extension-host.ts, src/services/code-index/interfaces/manager.ts, src/services/code-index/interfaces/config.ts
EmbedderProvider enum gains "semble" across all type boundaries. Configuration schemas add optional codebaseIndexSemblePath field and semble model dimension metadata.
Configuration loading and state tracking
src/services/code-index/config-manager.ts
CodeIndexConfigManager loads and caches codebaseIndexSemblePath, treats semble as unconditionally configured (no API keys), detects configuration changes to trigger service restart, and exposes path via currentSemblePath getter.
Semble CLI wrapper and types
src/services/code-index/semble/types.ts, src/services/code-index/semble/semble-cli.ts, src/services/code-index/semble/index.ts
SembleCLI wraps the semble Python CLI with methods for installation checking (via --help and pip show with fallback), semantic version validation (≥0.3.0), and search operations. Internal _spawn uses child_process.spawn with shell-safe arg handling, timeout/buffer enforcement, and JSON output parsing. Types define content filters, search results, and provider configuration.
Semble provider implementation
src/services/code-index/semble/provider.ts
SembleProvider orchestrates code search via semble CLI, manages lifecycle state (Standby/Indexed/Error), initializes by checking installation, converts CLI results into VectorStoreSearchResult objects, supports directory-prefix filtering, captures telemetry on errors, and provides state reset/disposal without deleting on-disk cache.
CodeIndexManager semble routing
src/services/code-index/manager.ts
CodeIndexManager conditionally delegates to SembleProvider when configured. Adds _sembleProvider field, refactors lifecycle methods (initialize, startIndexing, stopIndexing, searchIndex, clearIndexData) to route semble requests separately, updates state accessors to reflect semble state, and conditionally instantiates SembleProvider in _recreateServices based on embedder provider selection.
Service factory guards and model configuration
src/services/code-index/service-factory.ts, src/shared/embeddingModels.ts
CodeIndexServiceFactory explicitly rejects "semble" in createEmbedder and createVectorStore with clear error messages. EMBEDDING_MODEL_PROFILES adds semble provider with potion-code-16M model (dimension 256, threshold 0.4), and getDefaultModelId returns the correct default for semble.
Webview UI and state management
src/core/webview/ClineProvider.ts, src/core/webview/webviewMessageHandler.ts, webview-ui/src/components/chat/CodeIndexPopover.tsx, webview-ui/src/i18n/locales/en/settings.json
ClineProvider includes semble path in state payloads. WebviewMessageHandler persists semble path to global state. CodeIndexPopover adds semble to provider dropdown, renders optional path input and pip install guidance when semble is selected, hides Qdrant fields for semble, and validates only the enabled flag for semble. English i18n provides labels, placeholders, and pip install instructions.
SembleCLI test suite
src/services/code-index/semble/__tests__/semble-cli.spec.ts
Vitest suite covering constructor options, installation checks via --help and pip (with fallback to pip3), version validation, search/findRelated argument construction with shell-safe literal args, configurable topK and content filters, output parsing for v0.3.0+ nested JSON, error handling, and graceful non-JSON output recovery.
SembleProvider test suite
src/services/code-index/semble/__tests__/provider.spec.ts
Vitest suite covering constructor, lifecycle state transitions (initialize success/failure/idempotency, startIndexing behavior), search with uninitialized/Error state guards, CLI invocation and result conversion with deterministic IDs, file_path filtering, directoryPrefix resolution, telemetry on errors, clearIndexData state reset, and dispose final behavior.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • taltas
  • hannesrudolph
  • edelauna
  • JamesRobert20

Poem

A semble CLI now in sight,
No keys or Qdrant strings to fight,
Local hybrid search takes flight,
Configuration configs just right,
Code indexing: pure delight! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding Semble as a local, on-the-fly embedding provider for code indexing. It accurately reflects the primary objective of the PR.
Description check ✅ Passed The description comprehensively covers the implementation approach, design choices, testing procedures, and includes proper issue linkage. All required sections are completed with sufficient detail for reviewers to understand the changes.
Linked Issues check ✅ Passed The PR fully addresses the objectives from issue #200: provides integrated semble-based codebase indexing, simplifies UI setup with a checkbox and optional path field, reduces external dependencies by using a local on-the-fly approach, and leverages Semble as requested.
Out of Scope Changes check ✅ Passed All changes are directly related to integrating Semble as a local code indexing provider. Updates to types, schemas, configuration management, UI components, and the new Semble provider implementation are all within scope of the linked issue objective.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch semble

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/types/src/codebase-index.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/types/src/embedding.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

packages/types/src/vscode-extension-host.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 15 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@navedmerchant
Copy link
Copy Markdown
Contributor Author

Not ready for review yet, the code is being reviewed and evolved

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/services/code-index/interfaces/manager.ts (1)

78-87: ⚡ Quick win

Consider consolidating the duplicated EmbedderProvider type definition.

EmbedderProvider is defined both here and in packages/types/src/embedding.ts. Different parts of the codebase import from different locations (e.g., config-manager.ts imports from this file, while service-factory.ts imports from @roo-code/types). While currently in sync, maintaining two sources of truth creates risk of drift and inconsistency.

♻️ Suggested consolidation approach

Consider removing the local type definition and importing from the shared package instead:

+import { EmbedderProvider } from "`@roo-code/types`"
 import { VectorStoreSearchResult } from "./vector-store"
 import * as vscode from "vscode"
 
 /**
  * Interface for the code index manager
  */
 export interface ICodeIndexManager {
   // ... rest of interface
 
-export type IndexingState = "Standby" | "Indexing" | "Indexed" | "Error" | "Stopping"
-export type EmbedderProvider =
-	| "openai"
-	| "ollama"
-	| "openai-compatible"
-	| "gemini"
-	| "mistral"
-	| "vercel-ai-gateway"
-	| "bedrock"
-	| "openrouter"
-	| "semble"

This ensures a single source of truth and prevents accidental divergence.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/code-index/interfaces/manager.ts` around lines 78 - 87,
Duplicate EmbedderProvider type exists locally and in the shared package; remove
the local type definition (EmbedderProvider) from this file and replace
usages/imports (e.g., in config-manager.ts) to import the type from the
canonical package (`@roo-code/types` or packages/types/src/embedding.ts), update
any export or re-export as needed so service-factory.ts and other consumers use
the single source of truth, run TypeScript build/typecheck to ensure no
unresolved imports remain, and delete the now-unused local declaration to avoid
drift.
webview-ui/src/components/chat/CodeIndexPopover.tsx (1)

774-776: ⚡ Quick win

Consider adding test coverage for semble provider UI.

Per coding guidelines for webview-ui/src/**/*.{ts,tsx}, prefer local webview-ui tests for React/webview behavior. Consider adding tests under webview-ui/src/**/__tests__ to cover:

  • Selecting semble from the provider dropdown
  • Qdrant URL/API key fields hidden when semble is selected
  • Validation passes with only codebaseIndexEnabled for semble
  • Semble path input field renders and updates state correctly
  • Installation instructions panel renders

As per coding guidelines: "Prefer local webview-ui tests for React/webview behavior such as component rendering, local state, hooks, form dirty-state, validation, or prop wiring."

Also applies to: 1446-1482, 1484-1537

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview-ui/src/components/chat/CodeIndexPopover.tsx` around lines 774 - 776,
Add local webview-ui tests for the CodeIndexPopover component to cover the
semble provider UI: create tests under webview-ui/src/**/__tests__ that render
CodeIndexPopover, select the SelectItem with value "semble", assert that Qdrant
URL/API key fields are hidden, confirm validation passes when only
codebaseIndexEnabled is set for semble, verify the semble path input field
appears and updates component state on change, and assert the installation
instructions panel is rendered; use the existing test utilities (render,
fireEvent/userEvent, assertions) consistent with other webview-ui tests to
locate and interact with the provider dropdown and semble-specific inputs.
webview-ui/src/i18n/locales/en/settings.json (1)

204-204: 💤 Low value

Consider adding a Windows path example.

The semblePathDescription provides a helpful Unix path example ("/usr/local/bin/semble"), but users on Windows might benefit from seeing a Windows path example as well, such as "C:\\Python310\\Scripts\\semble.exe".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview-ui/src/i18n/locales/en/settings.json` at line 204, The translation
entry semblePathDescription currently shows only a Unix example; update its text
to include a Windows path example (e.g., "C:\\Python310\\Scripts\\semble.exe")
so Windows users have guidance—locate the semblePathDescription key in the
locales/en/settings.json and add a short Windows example alongside the existing
Unix example, keeping escaping consistent for backslashes and quotes.
src/services/code-index/semble/semble-cli.ts (1)

226-256: ⚡ Quick win

Consider adding runtime validation for CLI output structure.

Lines 242 and 247 use type assertions (as SembleSearchResult[]) without runtime validation. If the semble CLI output format changes or contains unexpected data, this could cause runtime errors downstream when code expects the SembleSearchResult shape.

Consider adding a simple validation helper or at least checking for required fields before casting.

🛡️ Example validation approach
 		// Handle successful response: {query, results: [{chunk, score}]}
 		if (parsed.results && Array.isArray(parsed.results)) {
-			return parsed.results as SembleSearchResult[]
+			// Basic validation: check that results have expected shape
+			return parsed.results.filter((r: any) => 
+				r?.chunk?.file_path && 
+				r?.chunk?.content && 
+				typeof r?.score === 'number'
+			) as SembleSearchResult[]
 		}
 
 		// Fallback: if it's a flat array (older format)
 		if (Array.isArray(parsed)) {
-			return parsed as SembleSearchResult[]
+			return parsed.filter((r: any) => 
+				r?.chunk?.file_path && 
+				r?.chunk?.content && 
+				typeof r?.score === 'number'
+			) as SembleSearchResult[]
 		}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/code-index/semble/semble-cli.ts` around lines 226 - 256, The
_parseOutput method casts parsed.results and parsed arrays to
SembleSearchResult[] without runtime checks; add a lightweight validator (e.g.,
validateSembleResult) and use it to filter/transform parsed.results and parsed
before returning to ensure each item has required properties (e.g., chunk is
string, score is number, and any other SembleSearchResult fields); replace the
direct casts in _parseOutput with Array.isArray checks plus
items.filter(validateSembleResult) (or map-to-safe-shape) so only well-formed
SembleSearchResult objects are returned and malformed entries are dropped or
logged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/services/code-index/semble/semble-cli.ts`:
- Around line 150-157: The spawn call in _spawn uses an unsupported maxBuffer
option and silences the TS error with an as any cast; remove the maxBuffer
property from the options passed to spawn(this.semblePath, args, { shell: false,
timeout: options.timeout, stdio: [...] }) and drop the as any cast, and if you
need to limit output implement manual buffering and size checks inside
child.stdout?.on("data", ...) and child.stderr?.on("data", ...) (e.g.,
accumulate into stdout/stderr strings, enforce a MAX_BUFFER threshold, kill the
child and reject if exceeded) while keeping the rest of _spawn (child handling,
resolve/reject) intact.

---

Nitpick comments:
In `@src/services/code-index/interfaces/manager.ts`:
- Around line 78-87: Duplicate EmbedderProvider type exists locally and in the
shared package; remove the local type definition (EmbedderProvider) from this
file and replace usages/imports (e.g., in config-manager.ts) to import the type
from the canonical package (`@roo-code/types` or packages/types/src/embedding.ts),
update any export or re-export as needed so service-factory.ts and other
consumers use the single source of truth, run TypeScript build/typecheck to
ensure no unresolved imports remain, and delete the now-unused local declaration
to avoid drift.

In `@src/services/code-index/semble/semble-cli.ts`:
- Around line 226-256: The _parseOutput method casts parsed.results and parsed
arrays to SembleSearchResult[] without runtime checks; add a lightweight
validator (e.g., validateSembleResult) and use it to filter/transform
parsed.results and parsed before returning to ensure each item has required
properties (e.g., chunk is string, score is number, and any other
SembleSearchResult fields); replace the direct casts in _parseOutput with
Array.isArray checks plus items.filter(validateSembleResult) (or
map-to-safe-shape) so only well-formed SembleSearchResult objects are returned
and malformed entries are dropped or logged.

In `@webview-ui/src/components/chat/CodeIndexPopover.tsx`:
- Around line 774-776: Add local webview-ui tests for the CodeIndexPopover
component to cover the semble provider UI: create tests under
webview-ui/src/**/__tests__ that render CodeIndexPopover, select the SelectItem
with value "semble", assert that Qdrant URL/API key fields are hidden, confirm
validation passes when only codebaseIndexEnabled is set for semble, verify the
semble path input field appears and updates component state on change, and
assert the installation instructions panel is rendered; use the existing test
utilities (render, fireEvent/userEvent, assertions) consistent with other
webview-ui tests to locate and interact with the provider dropdown and
semble-specific inputs.

In `@webview-ui/src/i18n/locales/en/settings.json`:
- Line 204: The translation entry semblePathDescription currently shows only a
Unix example; update its text to include a Windows path example (e.g.,
"C:\\Python310\\Scripts\\semble.exe") so Windows users have guidance—locate the
semblePathDescription key in the locales/en/settings.json and add a short
Windows example alongside the existing Unix example, keeping escaping consistent
for backslashes and quotes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 332e2e21-894e-4a2d-9e0f-464ce90a3d05

📥 Commits

Reviewing files that changed from the base of the PR and between 45088a7 and 147f1ea.

📒 Files selected for processing (19)
  • packages/types/src/codebase-index.ts
  • packages/types/src/embedding.ts
  • packages/types/src/vscode-extension-host.ts
  • src/core/webview/ClineProvider.ts
  • src/core/webview/webviewMessageHandler.ts
  • src/services/code-index/config-manager.ts
  • src/services/code-index/interfaces/config.ts
  • src/services/code-index/interfaces/manager.ts
  • src/services/code-index/manager.ts
  • src/services/code-index/semble/__tests__/provider.spec.ts
  • src/services/code-index/semble/__tests__/semble-cli.spec.ts
  • src/services/code-index/semble/index.ts
  • src/services/code-index/semble/provider.ts
  • src/services/code-index/semble/semble-cli.ts
  • src/services/code-index/semble/types.ts
  • src/services/code-index/service-factory.ts
  • src/shared/embeddingModels.ts
  • webview-ui/src/components/chat/CodeIndexPopover.tsx
  • webview-ui/src/i18n/locales/en/settings.json

Comment on lines +150 to +157
private _spawn(args: string[], options: { timeout: number }): Promise<{ stdout: string; stderr: string }> {
return new Promise((resolve, reject) => {
const child = spawn(this.semblePath, args, {
shell: false,
timeout: options.timeout,
maxBuffer: 10 * 1024 * 1024,
stdio: ["ignore", "pipe", "pipe"],
} as any)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove invalid maxBuffer option from spawn() call.

The maxBuffer option on line 155 is not supported by child_process.spawn(). The maxBuffer option only exists for exec() and execFile(). Setting it here has no effect, and the as any cast on line 157 suppresses the TypeScript error.

If buffer limiting is needed, consider implementing manual buffer size tracking in the data event handlers.

🔧 Proposed fix to remove unsupported option
 	private _spawn(args: string[], options: { timeout: number }): Promise<{ stdout: string; stderr: string }> {
 		return new Promise((resolve, reject) => {
 			const child = spawn(this.semblePath, args, {
 				shell: false,
 				timeout: options.timeout,
-				maxBuffer: 10 * 1024 * 1024,
 				stdio: ["ignore", "pipe", "pipe"],
-			} as any)
+			})

If you need to enforce buffer limits, add size checks in the data handlers:

const MAX_BUFFER = 10 * 1024 * 1024
let stdout = ""
let stderr = ""

child.stdout?.on("data", (data: Buffer) => {
	stdout += data.toString()
	if (stdout.length > MAX_BUFFER) {
		child.kill()
		reject(new Error("Output exceeded buffer limit"))
	}
})
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private _spawn(args: string[], options: { timeout: number }): Promise<{ stdout: string; stderr: string }> {
return new Promise((resolve, reject) => {
const child = spawn(this.semblePath, args, {
shell: false,
timeout: options.timeout,
maxBuffer: 10 * 1024 * 1024,
stdio: ["ignore", "pipe", "pipe"],
} as any)
private _spawn(args: string[], options: { timeout: number }): Promise<{ stdout: string; stderr: string }> {
return new Promise((resolve, reject) => {
const child = spawn(this.semblePath, args, {
shell: false,
timeout: options.timeout,
stdio: ["ignore", "pipe", "pipe"],
})
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/code-index/semble/semble-cli.ts` around lines 150 - 157, The
spawn call in _spawn uses an unsupported maxBuffer option and silences the TS
error with an as any cast; remove the maxBuffer property from the options passed
to spawn(this.semblePath, args, { shell: false, timeout: options.timeout, stdio:
[...] }) and drop the as any cast, and if you need to limit output implement
manual buffering and size checks inside child.stdout?.on("data", ...) and
child.stderr?.on("data", ...) (e.g., accumulate into stdout/stderr strings,
enforce a MAX_BUFFER threshold, kill the child and reject if exceeded) while
keeping the rest of _spawn (child handling, resolve/reject) intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add in built code indexing based on semble

1 participant