Fix QA validation issues and add M7.1 security fixes (#318)
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:
2026-02-04 03:08:09 +00:00
committed by jason.woltje
parent 482507ce4d
commit a1973e6419
178 changed files with 4902 additions and 74 deletions

View File

@@ -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");
});
});
});