fix: surface upstream gateway timeout for remote OpenClaw/Tailscale connections (#94)
* surface gateway timeout for tailscale * talescale fix #2 - attempt 1 * luke findings fix#1 * add narrow log for clientId * prod safe proxy log * fix log visibility * LAN connection & subagent SOUL|IDENTITY fixes * Initialize missing files for subagent SOUL|IDENTITY * surface missing files in UI * capturing agent - runtime,identity,session * plugin-install fix * fix: recover agent workspace for marketplace installs * fix: recover agent workspace and identity name from file provenance * fix: tolerate webchat session patch blocks during permission updates
This commit is contained in:
@@ -124,4 +124,92 @@ describe("skills install gateway", () => {
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects installs when the gateway reports the global root workspace", async () => {
|
||||
const call = vi.fn();
|
||||
|
||||
await expect(
|
||||
installPackagedSkillViaGatewayAgent({
|
||||
client: { call } as unknown as GatewayClient,
|
||||
request: {
|
||||
packageId: "todo-board",
|
||||
source: "openclaw-workspace",
|
||||
workspaceDir: "/home/pi/.openclaw/workspace",
|
||||
managedSkillsDir: "/home/pi/.openclaw/skills",
|
||||
agentId: "soundclaw",
|
||||
agentName: "soundclaw",
|
||||
},
|
||||
})
|
||||
).rejects.toThrow(/gateway root workspace/i);
|
||||
|
||||
expect(call).toHaveBeenCalledTimes(3);
|
||||
expect(call).toHaveBeenNthCalledWith(1, "agents.files.get", {
|
||||
agentId: "soundclaw",
|
||||
name: "IDENTITY.md",
|
||||
});
|
||||
});
|
||||
|
||||
it("repairs the workspace from agent file provenance before creating the installer agent", async () => {
|
||||
const call = vi.fn(async (method: string, params?: Record<string, unknown>) => {
|
||||
if (method === "agents.files.get") {
|
||||
expect(params).toEqual({ agentId: "main", name: "IDENTITY.md" });
|
||||
return {
|
||||
workspace: "/home/pi/.openclaw/workspace",
|
||||
file: {
|
||||
missing: false,
|
||||
content: "# IDENTITY",
|
||||
path: "/home/pi/.openclaw/workspace-main/IDENTITY.md",
|
||||
},
|
||||
};
|
||||
}
|
||||
if (method === "agents.create") {
|
||||
return { agentId: "installer-3" };
|
||||
}
|
||||
if (method === "config.get") {
|
||||
return {
|
||||
exists: true,
|
||||
hash: "hash-3",
|
||||
config: {
|
||||
agents: {
|
||||
list: [{ id: "installer-3", tools: {} }],
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
if (method === "config.set") {
|
||||
return { ok: true };
|
||||
}
|
||||
if (method === "config.patch") {
|
||||
return { ok: true };
|
||||
}
|
||||
if (method === "agents.list") {
|
||||
return { mainKey: "main" };
|
||||
}
|
||||
if (method === "chat.send") {
|
||||
return { runId: "run-3", status: "started" };
|
||||
}
|
||||
if (method === "agent.wait") {
|
||||
return { ok: true };
|
||||
}
|
||||
throw new Error(`Unexpected method: ${method}`);
|
||||
});
|
||||
|
||||
const result = await installPackagedSkillViaGatewayAgent({
|
||||
client: { call } as unknown as GatewayClient,
|
||||
request: {
|
||||
packageId: "todo-board",
|
||||
source: "openclaw-workspace",
|
||||
workspaceDir: "/home/pi/.openclaw/workspace",
|
||||
managedSkillsDir: "/home/pi/.openclaw/skills",
|
||||
agentId: "main",
|
||||
agentName: "main",
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.installedPath).toBe("/home/pi/.openclaw/workspace-main/skills/todo-board");
|
||||
expect(call).toHaveBeenCalledWith("agents.create", {
|
||||
name: expect.stringContaining("Skill Installer"),
|
||||
workspace: "/home/pi/.openclaw/workspace-main",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user