ruvnet/ruflo · error · TeammateError

TEAM_NOT_FOUND

TEAM_NOT_FOUND

Error message

Team not found: ${validatedName}

What it means

loadTeam() validated the team name and constructed the team directory, but config.json does not exist under teamsDir. The team was never created, was deleted, or lives on another storage root — the requested team simply has no on-disk state to load.

Source

Thrown at v3/plugins/teammate-plugin/src/teammate-bridge.ts:805

  }

  /**
   * Load an existing team
   */
  async loadTeam(teamName: string): Promise<TeamState> {
    this.ensureAvailable();

    // Security: Validate team name to prevent path traversal
    const validatedName = validateName(teamName, 'team');

    const teamDir = path.join(this.teamsDir, validatedName);
    // Security: Ensure path is within teams directory
    validatePath(teamDir, this.teamsDir);

    const configPath = path.join(teamDir, 'config.json');

    if (!fs.existsSync(configPath)) {
      throw new TeammateError(
        `Team not found: ${validatedName}`,
        TeammateErrorCode.TEAM_NOT_FOUND,
        validatedName
      );
    }

    // Security: Use safe JSON parsing
    const configContent = fs.readFileSync(configPath, 'utf-8');
    const config = safeJSONParse<TeamConfig>(configContent);

    // Load state file if exists
    const statePath = path.join(teamDir, 'state.json');
    let teamState: TeamState;

    if (fs.existsSync(statePath)) {
      // Security: Use safe JSON parsing
      const stateContent = fs.readFileSync(statePath, 'utf-8');
      const savedState = safeJSONParse<any>(stateContent);

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Verify the referenced identifier exists before use (list available items and match against user input).
  2. Return a clear 404-style error listing valid identifiers, and have the caller retry with an existing id.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/plugins/teammate-plugin/src/teammate-bridge.ts:805 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/7ab9eca7d5f17ad9. Report an issue: GitHub.