Clear stale frontend run state
This commit is contained in:
@@ -71,6 +71,11 @@ export const Assistant = () => {
|
||||
const replaySession = useCallback(
|
||||
(sessionId: string, repository: ExportedMessageRepository) => {
|
||||
writeActiveSessionId(sessionId);
|
||||
// 后端已经落盘/结束后,用回放结果接管当前会话。
|
||||
// 先取消本地仍挂起的 assistant-ui run,避免 UI 残留“运行中”且无法停止。
|
||||
if (runtime.thread.getState().isRunning) {
|
||||
runtime.thread.cancelRun();
|
||||
}
|
||||
runtime.thread.import(repository);
|
||||
},
|
||||
[runtime],
|
||||
|
||||
Reference in New Issue
Block a user