fix: reread config on in-process gateway restart (#80161) · openclaw/openclaw@294cdf9
scoootscooob
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -321,6 +321,41 @@ describe("gateway run option collisions", () => {
|
321 | 321 | expect(secondOptions.startupStartedAt).toBe(2000); |
322 | 322 | }); |
323 | 323 | |
| 324 | +it("uses the startup snapshot only for the first in-process gateway start", async () => { |
| 325 | +runGatewayLoop.mockImplementationOnce(async ({ start }: { start: GatewayLoopStart }) => { |
| 326 | +await start({ startupStartedAt: 1000 }); |
| 327 | +await start({ startupStartedAt: 2000 }); |
| 328 | +}); |
| 329 | + |
| 330 | +await runGatewayCli(["gateway", "run", "--allow-unconfigured"]); |
| 331 | + |
| 332 | +expect(startGatewayServer).toHaveBeenCalledTimes(2); |
| 333 | +expect(startGatewayServer).toHaveBeenNthCalledWith( |
| 334 | +1, |
| 335 | +18789, |
| 336 | +expect.objectContaining({ |
| 337 | +startupStartedAt: 1000, |
| 338 | +startupConfigSnapshotRead: { |
| 339 | +snapshot: configState.snapshot, |
| 340 | +}, |
| 341 | +}), |
| 342 | +); |
| 343 | +expect(startGatewayServer).toHaveBeenNthCalledWith( |
| 344 | +2, |
| 345 | +18789, |
| 346 | +expect.not.objectContaining({ |
| 347 | +startupConfigSnapshotRead: expect.anything(), |
| 348 | +}), |
| 349 | +); |
| 350 | +expect(startGatewayServer).toHaveBeenNthCalledWith( |
| 351 | +2, |
| 352 | +18789, |
| 353 | +expect.objectContaining({ |
| 354 | +startupStartedAt: 2000, |
| 355 | +}), |
| 356 | +); |
| 357 | +}); |
| 358 | + |
324 | 359 | it("logs when first startup will build missing Control UI assets", async () => { |
325 | 360 | controlUiState.root = null; |
326 | 361 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。