ruvnet/ruflo · error · TeammateError

TEAMMATE_NOT_FOUND

TEAMMATE_NOT_FOUND

Error message

No pending join request for agent: ${agentId}

What it means

approveJoin() searched the team's pendingJoinRequests for the given agentId and found no entry. Either the agent never submitted a join request, it was already approved/rejected, or the wrong agentId was passed — there is nothing pending to approve.

Source

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

      const config = JSON.parse(fs.readFileSync(configPath, 'utf-8')) as TeamConfig;
      if (config.autoApproveJoin) {
        await this.approveJoin(teamName, agentInfo.id);
      }
    }
  }

  /**
   * Approve a join request
   */
  async approveJoin(teamName: string, agentId: string): Promise<void> {
    this.ensureAvailable();

    const team = this.getTeamOrThrow(teamName);

    const requestIndex = team.pendingJoinRequests.findIndex(r => r.agentId === agentId);

    if (requestIndex === -1) {
      throw new TeammateError(
        `No pending join request for agent: ${agentId}`,
        TeammateErrorCode.TEAMMATE_NOT_FOUND,
        teamName,
        agentId
      );
    }

    const request = team.pendingJoinRequests.splice(requestIndex, 1)[0];

    const teammate: TeammateInfo = {
      id: agentId,
      name: request.agentName,
      role: request.role,
      status: 'active',
      spawnedAt: new Date(),
      messagesSent: 0,
      messagesReceived: 0,
    };

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Verify the agent has submitted a join request before approving; list pending requests first.
Defensive patterns

Strategy: validation

When it happens

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