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",
|
||||
"runtime": "unknown",
|
||||
"started_at": "2026-02-28T20:30:13Z",
|
||||
"ended_at": "",
|
||||
"ended_reason": "",
|
||||
"ended_at": "2026-03-01T14:04:00Z",
|
||||
"ended_reason": "completed",
|
||||
"milestone_at_end": "",
|
||||
"tasks_completed": [],
|
||||
"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 {
|
||||
id String @id @default(cuid())
|
||||
name String @unique // "jarvis-main", "jarvis-projects", etc.
|
||||
displayName String // "Jarvis (Main)", etc.
|
||||
name String @unique // "mosaic-main", "mosaic-projects", etc.
|
||||
displayName String // "Main Orchestrator", "Projects", etc.
|
||||
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
|
||||
model String // "zai/glm-5", "ollama/cogito"
|
||||
isActive Boolean @default(true)
|
||||
|
||||
@@ -26,7 +26,7 @@ describe("OpenClawGatewayService", () => {
|
||||
},
|
||||
};
|
||||
|
||||
const tokenEnvKey = "OPENCLAW_TOKEN_JARVIS_MAIN";
|
||||
const tokenEnvKey = "OPENCLAW_TOKEN_MOSAIC_MAIN";
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.clearAllMocks();
|
||||
@@ -52,10 +52,10 @@ describe("OpenClawGatewayService", () => {
|
||||
|
||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||
id: "agent-1",
|
||||
name: "jarvis-main",
|
||||
displayName: "Jarvis (Main)",
|
||||
name: "mosaic-main",
|
||||
displayName: "Main Orchestrator",
|
||||
role: "orchestrator",
|
||||
gatewayUrl: "http://jarvis-main:18789",
|
||||
gatewayUrl: "http://mosaic-main:18789",
|
||||
agentId: "main",
|
||||
model: "zai/glm-5",
|
||||
isActive: true,
|
||||
@@ -72,13 +72,13 @@ describe("OpenClawGatewayService", () => {
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
expect(chunks).toEqual(["Hello", " world"]);
|
||||
expect(mockHttpService.axiosRef.post).toHaveBeenCalledWith(
|
||||
"http://jarvis-main:18789/v1/chat/completions",
|
||||
"http://mosaic-main:18789/v1/chat/completions",
|
||||
{
|
||||
model: "openclaw:main",
|
||||
messages,
|
||||
@@ -109,10 +109,10 @@ describe("OpenClawGatewayService", () => {
|
||||
it("throws ServiceUnavailableException when agent is inactive", async () => {
|
||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||
id: "agent-1",
|
||||
name: "jarvis-main",
|
||||
displayName: "Jarvis (Main)",
|
||||
name: "mosaic-main",
|
||||
displayName: "Main Orchestrator",
|
||||
role: "orchestrator",
|
||||
gatewayUrl: "http://jarvis-main:18789",
|
||||
gatewayUrl: "http://mosaic-main:18789",
|
||||
agentId: "main",
|
||||
model: "zai/glm-5",
|
||||
isActive: false,
|
||||
@@ -122,7 +122,7 @@ describe("OpenClawGatewayService", () => {
|
||||
|
||||
await expect(
|
||||
(async () => {
|
||||
for await (const _chunk of service.streamChat("jarvis-main", [])) {
|
||||
for await (const _chunk of service.streamChat("mosaic-main", [])) {
|
||||
// no-op
|
||||
}
|
||||
})()
|
||||
@@ -134,10 +134,10 @@ describe("OpenClawGatewayService", () => {
|
||||
|
||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||
id: "agent-1",
|
||||
name: "jarvis-main",
|
||||
displayName: "Jarvis (Main)",
|
||||
name: "mosaic-main",
|
||||
displayName: "Main Orchestrator",
|
||||
role: "orchestrator",
|
||||
gatewayUrl: "http://jarvis-main:18789",
|
||||
gatewayUrl: "http://mosaic-main:18789",
|
||||
agentId: "main",
|
||||
model: "zai/glm-5",
|
||||
isActive: true,
|
||||
@@ -147,7 +147,7 @@ describe("OpenClawGatewayService", () => {
|
||||
|
||||
await expect(
|
||||
(async () => {
|
||||
for await (const _chunk of service.streamChat("jarvis-main", [])) {
|
||||
for await (const _chunk of service.streamChat("mosaic-main", [])) {
|
||||
// no-op
|
||||
}
|
||||
})()
|
||||
@@ -157,10 +157,10 @@ describe("OpenClawGatewayService", () => {
|
||||
it("throws UnauthorizedException when OpenClaw returns 401", async () => {
|
||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||
id: "agent-1",
|
||||
name: "jarvis-main",
|
||||
displayName: "Jarvis (Main)",
|
||||
name: "mosaic-main",
|
||||
displayName: "Main Orchestrator",
|
||||
role: "orchestrator",
|
||||
gatewayUrl: "http://jarvis-main:18789",
|
||||
gatewayUrl: "http://mosaic-main:18789",
|
||||
agentId: "main",
|
||||
model: "zai/glm-5",
|
||||
isActive: true,
|
||||
@@ -175,7 +175,7 @@ describe("OpenClawGatewayService", () => {
|
||||
|
||||
await expect(
|
||||
(async () => {
|
||||
for await (const _chunk of service.streamChat("jarvis-main", [])) {
|
||||
for await (const _chunk of service.streamChat("mosaic-main", [])) {
|
||||
// no-op
|
||||
}
|
||||
})()
|
||||
@@ -185,10 +185,10 @@ describe("OpenClawGatewayService", () => {
|
||||
it("throws ServiceUnavailableException when gateway is offline", async () => {
|
||||
mockPrisma.openClawAgent.findUnique.mockResolvedValue({
|
||||
id: "agent-1",
|
||||
name: "jarvis-main",
|
||||
displayName: "Jarvis (Main)",
|
||||
name: "mosaic-main",
|
||||
displayName: "Main Orchestrator",
|
||||
role: "orchestrator",
|
||||
gatewayUrl: "http://jarvis-main:18789",
|
||||
gatewayUrl: "http://mosaic-main:18789",
|
||||
agentId: "main",
|
||||
model: "zai/glm-5",
|
||||
isActive: true,
|
||||
@@ -203,7 +203,7 @@ describe("OpenClawGatewayService", () => {
|
||||
|
||||
await expect(
|
||||
(async () => {
|
||||
for await (const _chunk of service.streamChat("jarvis-main", [])) {
|
||||
for await (const _chunk of service.streamChat("mosaic-main", [])) {
|
||||
// no-op
|
||||
}
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user