mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:10:43 +00:00
test(ui): add regression test for session.message guard during active chat run
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -142,6 +142,22 @@ describe("handleGatewayEvent session.message", () => {
|
||||
expect(loadChatHistoryMock).toHaveBeenCalledWith(host);
|
||||
});
|
||||
|
||||
it("skips history reload while a chat run is active", () => {
|
||||
loadChatHistoryMock.mockReset();
|
||||
const host = createHost();
|
||||
host.sessionKey = "agent:qa:main";
|
||||
host.chatRunId = "run-123";
|
||||
|
||||
handleGatewayEvent(host, {
|
||||
type: "event",
|
||||
event: "session.message",
|
||||
payload: { sessionKey: "agent:qa:main" },
|
||||
seq: 1,
|
||||
});
|
||||
|
||||
expect(loadChatHistoryMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("ignores transcript updates for other sessions", () => {
|
||||
loadChatHistoryMock.mockReset();
|
||||
const host = createHost();
|
||||
|
||||
Reference in New Issue
Block a user