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