fix(api): use generic mosaic-* naming in OpenClawGateway schema and tests
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
Replaces all jarvis-* references with mosaic-* for generic multi-user deployment.
This commit is contained in:
@@ -80,8 +80,8 @@
|
|||||||
"session_id": "sess-002",
|
"session_id": "sess-002",
|
||||||
"runtime": "unknown",
|
"runtime": "unknown",
|
||||||
"started_at": "2026-02-28T20:30:13Z",
|
"started_at": "2026-02-28T20:30:13Z",
|
||||||
"ended_at": "",
|
"ended_at": "2026-03-01T14:04:00Z",
|
||||||
"ended_reason": "",
|
"ended_reason": "completed",
|
||||||
"milestone_at_end": "",
|
"milestone_at_end": "",
|
||||||
"tasks_completed": [],
|
"tasks_completed": [],
|
||||||
"last_task_id": ""
|
"last_task_id": ""
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"session_id": "sess-002",
|
|
||||||
"runtime": "unknown",
|
|
||||||
"pid": 3178395,
|
|
||||||
"started_at": "2026-02-28T20:30:13Z",
|
|
||||||
"project_path": "/tmp/ms21-ui-001",
|
|
||||||
"milestone_id": ""
|
|
||||||
}
|
|
||||||
@@ -1409,10 +1409,10 @@ model Instance {
|
|||||||
|
|
||||||
model OpenClawAgent {
|
model OpenClawAgent {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String @unique // "jarvis-main", "jarvis-projects", etc.
|
name String @unique // "mosaic-main", "mosaic-projects", etc.
|
||||||
displayName String // "Jarvis (Main)", etc.
|
displayName String // "Main Orchestrator", "Projects", etc.
|
||||||
role String // "orchestrator" | "developer" | "researcher" | "operations"
|
role String // "orchestrator" | "developer" | "researcher" | "operations"
|
||||||
gatewayUrl String // "http://jarvis-main:18789"
|
gatewayUrl String // "http://mosaic-main:18789"
|
||||||
agentId String @default("main") // OpenClaw agent id within that instance
|
agentId String @default("main") // OpenClaw agent id within that instance
|
||||||
model String // "zai/glm-5", "ollama/cogito"
|
model String // "zai/glm-5", "ollama/cogito"
|
||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ describe("OpenClawGatewayService", () => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const tokenEnvKey = "OPENCLAW_TOKEN_JARVIS_MAIN";
|
const tokenEnvKey = "OPENCLAW_TOKEN_MOSAIC_MAIN";
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
@@ -52,10 +52,10 @@ describe("OpenClawGatewayService", () => {
|
|||||||
|
|
||||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||||
id: "agent-1",
|
id: "agent-1",
|
||||||
name: "jarvis-main",
|
name: "mosaic-main",
|
||||||
displayName: "Jarvis (Main)",
|
displayName: "Main Orchestrator",
|
||||||
role: "orchestrator",
|
role: "orchestrator",
|
||||||
gatewayUrl: "http://jarvis-main:18789",
|
gatewayUrl: "http://mosaic-main:18789",
|
||||||
agentId: "main",
|
agentId: "main",
|
||||||
model: "zai/glm-5",
|
model: "zai/glm-5",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@@ -72,13 +72,13 @@ describe("OpenClawGatewayService", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const chunks: string[] = [];
|
const chunks: string[] = [];
|
||||||
for await (const chunk of service.streamChat("jarvis-main", messages)) {
|
for await (const chunk of service.streamChat("mosaic-main", messages)) {
|
||||||
chunks.push(chunk);
|
chunks.push(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(chunks).toEqual(["Hello", " world"]);
|
expect(chunks).toEqual(["Hello", " world"]);
|
||||||
expect(mockHttpService.axiosRef.post).toHaveBeenCalledWith(
|
expect(mockHttpService.axiosRef.post).toHaveBeenCalledWith(
|
||||||
"http://jarvis-main:18789/v1/chat/completions",
|
"http://mosaic-main:18789/v1/chat/completions",
|
||||||
{
|
{
|
||||||
model: "openclaw:main",
|
model: "openclaw:main",
|
||||||
messages,
|
messages,
|
||||||
@@ -109,10 +109,10 @@ describe("OpenClawGatewayService", () => {
|
|||||||
it("throws ServiceUnavailableException when agent is inactive", async () => {
|
it("throws ServiceUnavailableException when agent is inactive", async () => {
|
||||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||||
id: "agent-1",
|
id: "agent-1",
|
||||||
name: "jarvis-main",
|
name: "mosaic-main",
|
||||||
displayName: "Jarvis (Main)",
|
displayName: "Main Orchestrator",
|
||||||
role: "orchestrator",
|
role: "orchestrator",
|
||||||
gatewayUrl: "http://jarvis-main:18789",
|
gatewayUrl: "http://mosaic-main:18789",
|
||||||
agentId: "main",
|
agentId: "main",
|
||||||
model: "zai/glm-5",
|
model: "zai/glm-5",
|
||||||
isActive: false,
|
isActive: false,
|
||||||
@@ -122,7 +122,7 @@ describe("OpenClawGatewayService", () => {
|
|||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
(async () => {
|
(async () => {
|
||||||
for await (const _chunk of service.streamChat("jarvis-main", [])) {
|
for await (const _chunk of service.streamChat("mosaic-main", [])) {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
@@ -134,10 +134,10 @@ describe("OpenClawGatewayService", () => {
|
|||||||
|
|
||||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||||
id: "agent-1",
|
id: "agent-1",
|
||||||
name: "jarvis-main",
|
name: "mosaic-main",
|
||||||
displayName: "Jarvis (Main)",
|
displayName: "Main Orchestrator",
|
||||||
role: "orchestrator",
|
role: "orchestrator",
|
||||||
gatewayUrl: "http://jarvis-main:18789",
|
gatewayUrl: "http://mosaic-main:18789",
|
||||||
agentId: "main",
|
agentId: "main",
|
||||||
model: "zai/glm-5",
|
model: "zai/glm-5",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@@ -147,7 +147,7 @@ describe("OpenClawGatewayService", () => {
|
|||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
(async () => {
|
(async () => {
|
||||||
for await (const _chunk of service.streamChat("jarvis-main", [])) {
|
for await (const _chunk of service.streamChat("mosaic-main", [])) {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
@@ -157,10 +157,10 @@ describe("OpenClawGatewayService", () => {
|
|||||||
it("throws UnauthorizedException when OpenClaw returns 401", async () => {
|
it("throws UnauthorizedException when OpenClaw returns 401", async () => {
|
||||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||||
id: "agent-1",
|
id: "agent-1",
|
||||||
name: "jarvis-main",
|
name: "mosaic-main",
|
||||||
displayName: "Jarvis (Main)",
|
displayName: "Main Orchestrator",
|
||||||
role: "orchestrator",
|
role: "orchestrator",
|
||||||
gatewayUrl: "http://jarvis-main:18789",
|
gatewayUrl: "http://mosaic-main:18789",
|
||||||
agentId: "main",
|
agentId: "main",
|
||||||
model: "zai/glm-5",
|
model: "zai/glm-5",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@@ -175,7 +175,7 @@ describe("OpenClawGatewayService", () => {
|
|||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
(async () => {
|
(async () => {
|
||||||
for await (const _chunk of service.streamChat("jarvis-main", [])) {
|
for await (const _chunk of service.streamChat("mosaic-main", [])) {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
@@ -185,10 +185,10 @@ describe("OpenClawGatewayService", () => {
|
|||||||
it("throws ServiceUnavailableException when gateway is offline", async () => {
|
it("throws ServiceUnavailableException when gateway is offline", async () => {
|
||||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||||
id: "agent-1",
|
id: "agent-1",
|
||||||
name: "jarvis-main",
|
name: "mosaic-main",
|
||||||
displayName: "Jarvis (Main)",
|
displayName: "Main Orchestrator",
|
||||||
role: "orchestrator",
|
role: "orchestrator",
|
||||||
gatewayUrl: "http://jarvis-main:18789",
|
gatewayUrl: "http://mosaic-main:18789",
|
||||||
agentId: "main",
|
agentId: "main",
|
||||||
model: "zai/glm-5",
|
model: "zai/glm-5",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@@ -203,7 +203,7 @@ describe("OpenClawGatewayService", () => {
|
|||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
(async () => {
|
(async () => {
|
||||||
for await (const _chunk of service.streamChat("jarvis-main", [])) {
|
for await (const _chunk of service.streamChat("mosaic-main", [])) {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|||||||
Reference in New Issue
Block a user