fix(cli): don't force localhost gateway url in remote mode

Fixes remote gateway setup (remote mode) by not overriding url; adds regression tests. Thanks @oswalpalash.
This commit is contained in:
Palash Oswal
2026-01-06 09:30:45 -05:00
committed by GitHub
parent 5aa1ed2c96
commit b91012b697
6 changed files with 130 additions and 3 deletions

View File

@@ -81,6 +81,26 @@ describe("sendCommand", () => {
expect(runtime.log).toHaveBeenCalledWith(expect.stringContaining("g1"));
});
it("does not override remote gateway URL", async () => {
callGatewayMock.mockResolvedValueOnce({ messageId: "g2" });
testConfig = {
gateway: { mode: "remote", remote: { url: "wss://remote.example" } },
};
const deps = makeDeps();
await sendCommand(
{
to: "+1",
message: "hi",
},
deps,
runtime,
);
const args = callGatewayMock.mock.calls.at(-1)?.[0] as
| Record<string, unknown>
| undefined;
expect(args?.url).toBeUndefined();
});
it("passes gifPlayback to gateway send", async () => {
callGatewayMock.mockClear();
callGatewayMock.mockResolvedValueOnce({ messageId: "g1" });