fix: reread config on in-process gateway restart (#80161)

* fix: reread config on in-process gateway restart

* fix: refresh swift protocol model

(cherry picked from commit 537bcada37)
This commit is contained in:
scoootscooob
2026-05-10 04:01:19 -04:00
committed by Peter Steinberger
parent d86cf646fc
commit 294cdf973b

View File

@@ -321,6 +321,41 @@ describe("gateway run option collisions", () => {
expect(secondOptions.startupStartedAt).toBe(2000);
});
it("uses the startup snapshot only for the first in-process gateway start", async () => {
runGatewayLoop.mockImplementationOnce(async ({ start }: { start: GatewayLoopStart }) => {
await start({ startupStartedAt: 1000 });
await start({ startupStartedAt: 2000 });
});
await runGatewayCli(["gateway", "run", "--allow-unconfigured"]);
expect(startGatewayServer).toHaveBeenCalledTimes(2);
expect(startGatewayServer).toHaveBeenNthCalledWith(
1,
18789,
expect.objectContaining({
startupStartedAt: 1000,
startupConfigSnapshotRead: {
snapshot: configState.snapshot,
},
}),
);
expect(startGatewayServer).toHaveBeenNthCalledWith(
2,
18789,
expect.not.objectContaining({
startupConfigSnapshotRead: expect.anything(),
}),
);
expect(startGatewayServer).toHaveBeenNthCalledWith(
2,
18789,
expect.objectContaining({
startupStartedAt: 2000,
}),
);
});
it("logs when first startup will build missing Control UI assets", async () => {
controlUiState.root = null;