diff --git a/apps/api/src/federation/federation-auth.controller.ts b/apps/api/src/federation/federation-auth.controller.ts index 7cc01d0..9f9d2bf 100644 --- a/apps/api/src/federation/federation-auth.controller.ts +++ b/apps/api/src/federation/federation-auth.controller.ts @@ -135,7 +135,7 @@ export class FederationAuthController { */ @Post("validate") @Throttle({ short: { limit: 3, ttl: 1000 } }) - validateToken(@Body() dto: ValidateFederatedTokenDto): FederatedTokenValidation { + async validateToken(@Body() dto: ValidateFederatedTokenDto): Promise { this.logger.debug(`Validating federated token from ${dto.instanceId}`); return this.oidcService.validateToken(dto.token, dto.instanceId); diff --git a/apps/api/src/federation/federation.module.ts b/apps/api/src/federation/federation.module.ts index 9703cd6..ebccd9f 100644 --- a/apps/api/src/federation/federation.module.ts +++ b/apps/api/src/federation/federation.module.ts @@ -10,7 +10,7 @@ import { ConfigModule } from "@nestjs/config"; import { HttpModule } from "@nestjs/axios"; import { ThrottlerModule } from "@nestjs/throttler"; import { FederationController } from "./federation.controller"; -import { FederationAuthController} from "./federation-auth.controller"; +import { FederationAuthController } from "./federation-auth.controller"; import { FederationService } from "./federation.service"; import { CryptoService } from "./crypto.service"; import { FederationAuditService } from "./audit.service"; diff --git a/apps/orchestrator/src/api/agents/agents-killswitch.controller.spec.ts b/apps/orchestrator/src/api/agents/agents-killswitch.controller.spec.ts index 71081cb..9fd7b50 100644 --- a/apps/orchestrator/src/api/agents/agents-killswitch.controller.spec.ts +++ b/apps/orchestrator/src/api/agents/agents-killswitch.controller.spec.ts @@ -2,6 +2,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from "vitest"; import { AgentsController } from "./agents.controller"; import { QueueService } from "../../queue/queue.service"; import { AgentSpawnerService } from "../../spawner/agent-spawner.service"; +import { AgentLifecycleService } from "../../spawner/agent-lifecycle.service"; import { KillswitchService } from "../../killswitch/killswitch.service"; import type { KillAllResult } from "../../killswitch/killswitch.service"; @@ -17,6 +18,9 @@ describe("AgentsController - Killswitch Endpoints", () => { let mockSpawnerService: { spawnAgent: ReturnType; }; + let mockLifecycleService: { + getAgentLifecycleState: ReturnType; + }; beforeEach(() => { mockKillswitchService = { @@ -32,9 +36,14 @@ describe("AgentsController - Killswitch Endpoints", () => { spawnAgent: vi.fn(), }; + mockLifecycleService = { + getAgentLifecycleState: vi.fn(), + }; + controller = new AgentsController( mockQueueService as unknown as QueueService, mockSpawnerService as unknown as AgentSpawnerService, + mockLifecycleService as unknown as AgentLifecycleService, mockKillswitchService as unknown as KillswitchService ); }); diff --git a/apps/orchestrator/src/api/agents/agents.controller.spec.ts b/apps/orchestrator/src/api/agents/agents.controller.spec.ts index 2a0de8a..1cb00fc 100644 --- a/apps/orchestrator/src/api/agents/agents.controller.spec.ts +++ b/apps/orchestrator/src/api/agents/agents.controller.spec.ts @@ -1,6 +1,7 @@ import { AgentsController } from "./agents.controller"; import { QueueService } from "../../queue/queue.service"; import { AgentSpawnerService } from "../../spawner/agent-spawner.service"; +import { AgentLifecycleService } from "../../spawner/agent-lifecycle.service"; import { KillswitchService } from "../../killswitch/killswitch.service"; import { BadRequestException } from "@nestjs/common"; import { describe, it, expect, beforeEach, afterEach, vi } from "vitest"; @@ -13,6 +14,9 @@ describe("AgentsController", () => { let spawnerService: { spawnAgent: ReturnType; }; + let lifecycleService: { + getAgentLifecycleState: ReturnType; + }; let killswitchService: { killAgent: ReturnType; killAllAgents: ReturnType; @@ -28,6 +32,10 @@ describe("AgentsController", () => { spawnAgent: vi.fn(), }; + lifecycleService = { + getAgentLifecycleState: vi.fn(), + }; + killswitchService = { killAgent: vi.fn(), killAllAgents: vi.fn(), @@ -37,6 +45,7 @@ describe("AgentsController", () => { controller = new AgentsController( queueService as unknown as QueueService, spawnerService as unknown as AgentSpawnerService, + lifecycleService as unknown as AgentLifecycleService, killswitchService as unknown as KillswitchService ); });