From 0318848e21bfd338f8ed66db5a53bacfb05c727b Mon Sep 17 00:00:00 2001 From: Zane Staggs Date: Tue, 21 Oct 2025 10:02:22 -0700 Subject: [PATCH 1/2] get sessionId for pair --- ui/desktop/src/App.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/desktop/src/App.tsx b/ui/desktop/src/App.tsx index f5fc012b2820..c468a534ee51 100644 --- a/ui/desktop/src/App.tsx +++ b/ui/desktop/src/App.tsx @@ -94,11 +94,17 @@ const PairRouteWrapper = ({ const resumeSessionId = searchParams.get('resumeSessionId') ?? undefined; + // Determine which session ID to use: + // 1. From route state (when navigating from Hub with a new session) + // 2. From URL params (when resuming a session) + // 3. From the existing chat state (when navigating to Pair directly) + const sessionId = routeState.resumeSessionId || resumeSessionId || chat.sessionId; + return process.env.ALPHA ? ( ) : ( From 8237020000d0d602b2555113cd518a2521baf14e Mon Sep 17 00:00:00 2001 From: Zane Staggs Date: Tue, 21 Oct 2025 10:08:19 -0700 Subject: [PATCH 2/2] fix refresh from new chat in pair --- ui/desktop/src/App.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/desktop/src/App.tsx b/ui/desktop/src/App.tsx index c468a534ee51..fb766f00478f 100644 --- a/ui/desktop/src/App.tsx +++ b/ui/desktop/src/App.tsx @@ -89,7 +89,7 @@ const PairRouteWrapper = ({ const setView = useNavigation(); const routeState = (location.state as PairRouteState) || (window.history.state as PairRouteState) || {}; - const [searchParams] = useSearchParams(); + const [searchParams, setSearchParams] = useSearchParams(); const [initialMessage] = useState(routeState.initialMessage); const resumeSessionId = searchParams.get('resumeSessionId') ?? undefined; @@ -100,6 +100,16 @@ const PairRouteWrapper = ({ // 3. From the existing chat state (when navigating to Pair directly) const sessionId = routeState.resumeSessionId || resumeSessionId || chat.sessionId; + // Update URL with session ID if it's not already there (new chat from pair) + useEffect(() => { + if (process.env.ALPHA && sessionId && sessionId !== resumeSessionId) { + setSearchParams((prev) => { + prev.set('resumeSessionId', sessionId); + return prev; + }); + } + }, [sessionId, resumeSessionId, setSearchParams]); + return process.env.ALPHA ? (