diff --git a/frontend/app/components/assistant-ui/thread.tsx b/frontend/app/components/assistant-ui/thread.tsx index 33123da..a26fe77 100644 --- a/frontend/app/components/assistant-ui/thread.tsx +++ b/frontend/app/components/assistant-ui/thread.tsx @@ -422,13 +422,17 @@ async function cancelLatestRun(sessionId: string, runId?: string | null) { const ChatTopActions: FC = () => { const { openFiles } = useActivityPanel(); const [workspaceOpen, setWorkspaceOpen] = useState(false); - const normalizedSessionId = useCurrentThreadSessionId({ + const actionSessionId = useCurrentThreadSessionId({ includePending: true, // 工作区切换必须绑定当前可见会话;空白新会话不能回退到上一个 // activeSessionId,否则会把 Jupyter 工作区切到旧会话上。 includeActive: false, }); - const workspaceStatus = useJupyterWorkspaceStatus(normalizedSessionId); + const displaySessionId = useCurrentThreadSessionId({ + includePending: true, + includeActive: true, + }); + const workspaceStatus = useJupyterWorkspaceStatus(displaySessionId); return (