Fix QA validation issues and add M7.1 security fixes (#318)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #318.
This commit is contained in:
@@ -419,13 +419,12 @@ describe("FederationAgentService", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("should return error for unknown command type", async () => {
|
||||
it("should throw UnknownCommandTypeError for unknown command type", async () => {
|
||||
prisma.federationConnection.findFirst.mockResolvedValue(mockConnection as never);
|
||||
|
||||
const result = await service.handleAgentCommand("remote-instance-1", "agent.unknown", {});
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.error).toContain("Unknown agent command type: agent.unknown");
|
||||
await expect(
|
||||
service.handleAgentCommand("remote-instance-1", "agent.unknown", {})
|
||||
).rejects.toThrow("Unknown command type: agent.unknown");
|
||||
});
|
||||
|
||||
it("should throw error if connection not found", async () => {
|
||||
@@ -436,7 +435,7 @@ describe("FederationAgentService", () => {
|
||||
).rejects.toThrow("No connection found for remote instance");
|
||||
});
|
||||
|
||||
it("should handle orchestrator errors", async () => {
|
||||
it("should throw AgentCommandError for orchestrator errors", async () => {
|
||||
const spawnPayload: SpawnAgentCommandPayload = {
|
||||
taskId: mockTaskId,
|
||||
agentType: "worker",
|
||||
@@ -453,14 +452,9 @@ describe("FederationAgentService", () => {
|
||||
throwError(() => new Error("Orchestrator connection failed")) as never
|
||||
);
|
||||
|
||||
const result = await service.handleAgentCommand(
|
||||
"remote-instance-1",
|
||||
"agent.spawn",
|
||||
spawnPayload
|
||||
);
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.error).toContain("Orchestrator connection failed");
|
||||
await expect(
|
||||
service.handleAgentCommand("remote-instance-1", "agent.spawn", spawnPayload)
|
||||
).rejects.toThrow("Failed to spawn agent: Orchestrator connection failed");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user