ruvnet/ruflo · error · BdBridgeError

INVALID_ARGUMENT

INVALID_ARGUMENT

Error message

Command not allowed: ${subcommand}

What it means

execBd() validated the (already-sanitized) first argument against the ALLOWED_BD_COMMANDS allowlist and it is not an permitted subcommand. The bd bridge only executes whitelisted subcommands; the rejected subcommand name is included so the caller can see which token was blocked.

Source

Thrown at v3/plugins/gastown-bridge/src/bridges/bd-bridge.ts:434

    }
  }

  /**
   * Execute a bd command with validated arguments
   *
   * @param args - Command arguments (validated and sanitized)
   * @returns Command output
   */
  async execBd(args: string[], skipCache = false): Promise<BdResult<string>> {
    const startTime = Date.now();

    // Validate all arguments
    const validatedArgs = this.validateAndSanitizeArgs(args);

    // Validate subcommand is allowed
    const subcommand = validatedArgs[0];
    if (subcommand && !ALLOWED_BD_COMMANDS.has(subcommand)) {
      throw new BdBridgeError(
        `Command not allowed: ${subcommand}`,
        'INVALID_ARGUMENT',
        'bd',
        validatedArgs
      );
    }

    // Check cache for cacheable commands
    const cacheKey = hashArgs(validatedArgs);
    const isCacheable = !skipCache && subcommand && BdBridge.CACHEABLE_COMMANDS.has(subcommand);
    const isStatic = subcommand && BdBridge.STATIC_COMMANDS.has(subcommand);

    if (isCacheable) {
      const cached = staticCache.get(cacheKey) as BdResult<string> | undefined;
      if (cached) {
        this.logger.debug('Cache hit for bd command', { command: subcommand });
        return {
          ...cached,

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Use only subcommands present in the allowlist; add the subcommand to the allowlist if it is legitimate.
  2. Validate user-supplied commands against the allowlist before dispatch and report the permitted set.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/plugins/gastown-bridge/src/bridges/bd-bridge.ts:434 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class

Background: "must be a positive integer", "cannot be empty", "invalid argument": how invalid-argument errors work across open-source libraries — this error's family across 33 libraries.


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