mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-05 14:02:11 +00:00
fix: honor qr remote precedence and wire clawbot alias
This commit is contained in:
@@ -101,4 +101,38 @@ describe("pairing setup code", () => {
|
||||
urlSource: "gateway.tailscale.mode=serve",
|
||||
});
|
||||
});
|
||||
|
||||
it("prefers gateway.remote.url over tailscale when requested", async () => {
|
||||
const runCommandWithTimeout = vi.fn(async () => ({
|
||||
code: 0,
|
||||
stdout: '{"Self":{"DNSName":"mb-server.tailnet.ts.net."}}',
|
||||
stderr: "",
|
||||
}));
|
||||
|
||||
const resolved = await resolvePairingSetupFromConfig(
|
||||
{
|
||||
gateway: {
|
||||
tailscale: { mode: "serve" },
|
||||
remote: { url: "wss://remote.example.com:444" },
|
||||
auth: { mode: "token", token: "tok_123" },
|
||||
},
|
||||
},
|
||||
{
|
||||
preferRemoteUrl: true,
|
||||
runCommandWithTimeout,
|
||||
},
|
||||
);
|
||||
|
||||
expect(resolved).toEqual({
|
||||
ok: true,
|
||||
payload: {
|
||||
url: "wss://remote.example.com:444",
|
||||
token: "tok_123",
|
||||
password: undefined,
|
||||
},
|
||||
authLabel: "token",
|
||||
urlSource: "gateway.remote.url",
|
||||
});
|
||||
expect(runCommandWithTimeout).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user