Fix Jupyter workspace session handoff
This commit is contained in:
@@ -83,6 +83,7 @@ import {
|
||||
clearActiveSessionId,
|
||||
readActiveSessionId,
|
||||
writeActiveSessionId,
|
||||
writePendingWorkspaceSessionId,
|
||||
} from "@/lib/claw-active-session";
|
||||
import { useClawSessionReplay } from "@/lib/claw-session-replay";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -437,6 +438,7 @@ function WorkspaceSwitchDialog({
|
||||
setSubmitting(true);
|
||||
const progressTimer = startWorkspaceProgress(setProgress);
|
||||
try {
|
||||
const needsFirstMessageSession = !normalizeSessionId(sessionId);
|
||||
const response = await fetch("/api/claw/jupyter", {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
@@ -455,6 +457,9 @@ function WorkspaceSwitchDialog({
|
||||
return;
|
||||
}
|
||||
writeActiveSessionId(sessionIdForRequest);
|
||||
if (needsFirstMessageSession) {
|
||||
writePendingWorkspaceSessionId(sessionIdForRequest);
|
||||
}
|
||||
setStatus(payload as JupyterWorkspaceStatus);
|
||||
setProgress({ percent: 100, label: "切换完成" });
|
||||
setMessage("工作区切换成功,后续工具会在远端 Jupyter 工作区执行。");
|
||||
|
||||
Reference in New Issue
Block a user