Skip to content

Commit

Permalink
fix(frontend): Recover full message history if exists (#4961)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanape authored Nov 13, 2024
1 parent b3fbbba commit 79ed4e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions frontend/src/components/event-handler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
} from "#/context/ws-client-provider";
import { ErrorObservation } from "#/types/core/observations";
import { addErrorMessage, addUserMessage } from "#/state/chatSlice";
import { handleAssistantMessage } from "#/services/actions";
import {
getCloneRepoCommand,
getGitHubTokenCommand,
Expand Down Expand Up @@ -112,9 +111,7 @@ export function EventHandler({ children }: React.PropsWithChildren) {
message: event.message,
}),
);
return;
}
handleAssistantMessage(event);
}, [events.length]);

React.useEffect(() => {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/context/ws-client-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Settings } from "#/services/settings";
import ActionType from "#/types/ActionType";
import EventLogger from "#/utils/event-logger";
import AgentState from "#/types/AgentState";
import { handleAssistantMessage } from "#/services/actions";

const RECONNECT_RETRIES = 5;

Expand Down Expand Up @@ -80,6 +81,8 @@ export function WsClientProvider({
) {
setStatus(WsClientProviderStatus.ERROR);
}

handleAssistantMessage(event);
}

function handleClose() {
Expand Down

0 comments on commit 79ed4e3

Please sign in to comment.