Keep active session URL in sync
This commit is contained in:
@@ -12,11 +12,11 @@ import {
|
||||
ActivityPanel,
|
||||
ActivityProvider,
|
||||
} from "@/components/assistant-ui/activity-panel";
|
||||
import { Thread } from "@/components/assistant-ui/thread";
|
||||
import {
|
||||
fetchLatestRunStatus,
|
||||
toReplayRepository,
|
||||
} from "@/components/assistant-ui/thread-list";
|
||||
import { Thread } from "@/components/assistant-ui/thread";
|
||||
import { ThreadListSidebar } from "@/components/assistant-ui/threadlist-sidebar";
|
||||
import {
|
||||
SidebarInset,
|
||||
@@ -28,8 +28,8 @@ import {
|
||||
readPendingWorkspaceSessionId,
|
||||
writeActiveSessionId,
|
||||
} from "@/lib/claw-active-session";
|
||||
import { pushSessionUrl } from "@/lib/claw-session-url";
|
||||
import { ClawSessionReplayProvider } from "@/lib/claw-session-replay";
|
||||
import { pushSessionUrl } from "@/lib/claw-session-url";
|
||||
import { ClawAccountGate, useClawAccount } from "./claw-account-gate";
|
||||
|
||||
type AssistantProps = {
|
||||
@@ -61,6 +61,7 @@ export const Assistant = ({ initialSessionId }: AssistantProps = {}) => {
|
||||
.reverse()
|
||||
.find((message) => message.role === "user");
|
||||
writeActiveSessionId(outgoingSessionId);
|
||||
pushSessionUrl(outgoingSessionId);
|
||||
|
||||
return {
|
||||
body: {
|
||||
@@ -81,6 +82,7 @@ export const Assistant = ({ initialSessionId }: AssistantProps = {}) => {
|
||||
const replaySession = useCallback(
|
||||
(sessionId: string, repository: ExportedMessageRepository) => {
|
||||
writeActiveSessionId(sessionId);
|
||||
pushSessionUrl(sessionId);
|
||||
// 后端已经落盘/结束后,用回放结果接管当前会话。
|
||||
// 先取消本地仍挂起的 assistant-ui run,避免 UI 残留“运行中”且无法停止。
|
||||
if (runtime.thread.getState().isRunning) {
|
||||
|
||||
Reference in New Issue
Block a user