Clear stale frontend run state
This commit is contained in:
@@ -908,6 +908,7 @@ const ComposerWorkspaceStatus: FC<{ sessionId: string | null }> = ({
|
||||
};
|
||||
|
||||
const ComposerAction: FC = () => {
|
||||
const aui = useAui();
|
||||
const runtimeRunning = useAuiState((s) => s.thread.isRunning);
|
||||
const replayedRun = useReplayedRunState();
|
||||
const currentSessionId = useCurrentThreadSessionId({
|
||||
@@ -955,6 +956,8 @@ const ComposerAction: FC = () => {
|
||||
void cancelLatestRun(cancelSessionId, replayedRun.runId)
|
||||
.catch(() => undefined)
|
||||
.finally(() => {
|
||||
// 后端可能已经 idle;无论取消接口是否真的命中 run,都清理本地残留运行态。
|
||||
aui.thread().cancelRun();
|
||||
window.setTimeout(() => setRuntimeCancelling(false), 1200);
|
||||
});
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user