ruvnet/ruflo · error

Attention module not initialized

Error message

Attention module not initialized

What it means

flashAttention() was called while this._module is null: the attention WASM module was never initialized or was destroyed. It is a lifecycle sentinel guard — the computation cannot be delegated to the native module; inputs are not the problem.

Source

Thrown at v3/plugins/ruvector-upstream/src/bridges/attention.ts:98

  isReady(): boolean {
    return this._status === 'ready';
  }

  getModule(): AttentionModule | null {
    return this._module;
  }

  /**
   * Compute flash attention
   */
  flashAttention(
    query: Float32Array,
    key: Float32Array,
    value: Float32Array,
    config?: Partial<AttentionConfig>
  ): Float32Array {
    if (!this._module) throw new Error('Attention module not initialized');
    const mergedConfig = { ...this.config, ...config };
    return this._module.flashAttention(query, key, value, mergedConfig);
  }

  /**
   * Compute multi-head attention
   */
  multiHeadAttention(
    query: Float32Array,
    key: Float32Array,
    value: Float32Array,
    config?: Partial<AttentionConfig>
  ): Float32Array {
    if (!this._module) throw new Error('Attention module not initialized');
    const mergedConfig = { ...this.config, ...config };
    return this._module.multiHeadAttention(query, key, value, mergedConfig);
  }

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Ensure the module/bridge/plugin initialize() method has been called and awaited before invoking this operation.
  2. Guard against calls made during startup: await the initialization promise or check the initialized flag and fail fast with a clear setup hint.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/plugins/ruvector-upstream/src/bridges/attention.ts:98 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/3894ec8bd0f65c92. Report an issue: GitHub.