ruvnet/ruflo · error

Invalid dimensions: ${this.dimensions}. Must be a positive i

Error message

Invalid dimensions: ${this.dimensions}. Must be a positive integer.

What it means

Thrown when the RVF embedding service is constructed with a non-positive or non-integer dimensions value. Defense: validate configuration at startup and require a positive integer before any embedding call.

Source

Thrown at v3/@claude-flow/embeddings/src/rvf-embedding-service.ts:143

 * vector in R^n where n = configured dimensions (default 384).
 *
 * Extends EventEmitter and implements IEmbeddingService for drop-in
 * compatibility with other providers.
 */
export class RvfEmbeddingService extends EventEmitter implements IEmbeddingService {
  readonly provider: EmbeddingProvider = 'rvf';

  private readonly dimensions: number;
  private readonly cache: LRUCache<string, Float32Array>;
  private readonly normalizationType: NormalizationType;
  private readonly embeddingListeners: Set<EmbeddingEventListener> = new Set();
  private persistentCache: RvfEmbeddingCache | null = null;

  constructor(config: RvfEmbeddingConfig) {
    super();
    this.dimensions = config.dimensions ?? DEFAULT_DIMENSIONS;
    if (this.dimensions <= 0 || !Number.isInteger(this.dimensions)) {
      throw new Error(`Invalid dimensions: ${this.dimensions}. Must be a positive integer.`);
    }
    this.cache = new LRUCache(config.cacheSize ?? DEFAULT_CACHE_SIZE);
    this.normalizationType = config.normalization ?? 'none';

    // Initialize persistent RVF cache if a path is provided
    if (config.cachePath) {
      this.persistentCache = new RvfEmbeddingCache({
        cachePath: config.cachePath,
        maxSize: config.cacheSize ?? 10000,
        dimensions: this.dimensions,
      });
    }
  }

  // --------------------------------------------------------------------------
  // IEmbeddingService Implementation
  // --------------------------------------------------------------------------

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Set dimensions to a positive integer matching the embedding model's output size.
  2. Read the model's reported dimension instead of hardcoding an invalid value.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/embeddings/src/rvf-embedding-service.ts:143 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/f8882abe63259cee. Report an issue: GitHub.