feat(chat, gateway): implement error recovery timer and enhance histo… (#179)

This commit is contained in:
Haze
2026-02-26 11:26:39 +08:00
committed by GitHub
Unverified
parent 264ef460a5
commit 96ac13fd90
2 changed files with 80 additions and 6 deletions

View File

@@ -99,8 +99,18 @@ export const useGatewayStore = create<GatewayState>((set, get) => ({
import('./chat')
.then(({ useChatStore }) => {
const state = useChatStore.getState();
// Always reload history on agent completion, regardless of
// the `sending` flag. After a transient error the flag may
// already be false, but the Gateway may have retried and
// completed successfully in the background.
state.loadHistory(true);
if (state.sending) {
state.loadHistory(true);
useChatStore.setState({
sending: false,
activeRunId: null,
pendingFinal: false,
lastUserMessageAt: null,
});
}
})
.catch(() => {});