From 970c631eac7ef33c7f0fed41db4ec65d342681d3 Mon Sep 17 00:00:00 2001
From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com>
Date: Wed, 18 Nov 2026 15:40:51 +0000
Subject: [PATCH 1/3] fix(chat): keep a chat on screen and load its history
again when the host cannot read it
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
A chat could open blank: only the composer, with the title in the header.
When the host had the chat but could not read its history (getOutline and
getItems both returned ok:false, for example journal_missing), the session
hook wiped the transcript, reported "ready", subscribed from the current
cursor and never read the history again. The pane stayed blank until a
reload, even after the host could read the history.
The hook now keeps what it shows, still subscribes so live events and
sending work, sets the session state from the host's row, drops a cache
from another epoch, and loads the history again with backoff (up to 60 s).
It reports historyUnavailable, and a resync from a stream reset that
succeeds also clears it. resync now has the seed timeout, so a hung request
cannot block later resyncs.
The chat pane now says what is happening instead of rendering nothing:
"Loading chat" after 500 ms, "Can't reach this workspace's host.
Retrying…" when the host does not answer (unreachable was never shown),
and "Couldn't load this chat's messages. Retrying…" while the history
cannot be read.
---
.../components/SessionView/SessionView.tsx | 9 ++
.../TranscriptLoadState.tsx | 49 +++++++
.../components/TranscriptLoadState/index.ts | 1 +
.../useChatSession/useChatSession.test.tsx | 68 ++++++++++
.../react/useChatSession/useChatSession.ts | 124 ++++++++++++++----
packages/i18n/locales/cs/messages.po | 6 +
packages/i18n/locales/de/messages.po | 6 +
packages/i18n/locales/en/messages.po | 6 +
packages/i18n/locales/es/messages.po | 6 +
packages/i18n/locales/fr/messages.po | 6 +
packages/i18n/locales/id/messages.po | 6 +
packages/i18n/locales/it/messages.po | 6 +
packages/i18n/locales/ja/messages.po | 6 +
packages/i18n/locales/ko/messages.po | 6 +
packages/i18n/locales/nl/messages.po | 6 +
packages/i18n/locales/pl/messages.po | 6 +
packages/i18n/locales/pt-BR/messages.po | 6 +
packages/i18n/locales/ru/messages.po | 6 +
packages/i18n/locales/tr/messages.po | 6 +
packages/i18n/locales/uk/messages.po | 6 +
packages/i18n/locales/vi/messages.po | 6 +
packages/i18n/locales/zh-CN/messages.po | 6 +
packages/i18n/locales/zh-TW/messages.po | 6 +
23 files changed, 333 insertions(+), 26 deletions(-)
create mode 100644 apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/TranscriptLoadState/TranscriptLoadState.tsx
create mode 100644 apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/TranscriptLoadState/index.ts
diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/SessionView.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/SessionView.tsx
index 6e47072cf68..daf3ec614a6 100644
--- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/SessionView.tsx
+++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/SessionView.tsx
@@ -75,6 +75,7 @@ import {
type WorkDrawerHandle,
} from "../WorkDrawer";
import { ComposerChips } from "./components/ComposerChips";
+import { TranscriptLoadState } from "./components/TranscriptLoadState";
import {
type SwitchAccount,
type SwitchableAgent,
@@ -750,6 +751,14 @@ export function SessionView({
+ {!focusedSubagentId && (
+
+ )}
{!focusedSubagentId && rail.length > 1 && (
{
+ if (!loading) {
+ setSlow(false);
+ return;
+ }
+ const timer = setTimeout(() => setSlow(true), SLOW_LOAD_MS);
+ return () => clearTimeout(timer);
+ }, [loading]);
+
+ if (historyUnavailable) {
+ return (
+
+
+
+ );
+ }
+ if (!empty || !loading || (!unreachable && !slow)) return null;
+ return (
+
+ );
+}
diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/TranscriptLoadState/index.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/TranscriptLoadState/index.ts
new file mode 100644
index 00000000000..d12ce5d49c5
--- /dev/null
+++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/TranscriptLoadState/index.ts
@@ -0,0 +1 @@
+export { TranscriptLoadState } from "./TranscriptLoadState";
diff --git a/packages/chat/src/react/useChatSession/useChatSession.test.tsx b/packages/chat/src/react/useChatSession/useChatSession.test.tsx
index 325c58b2fe6..1b34eafe1f6 100644
--- a/packages/chat/src/react/useChatSession/useChatSession.test.tsx
+++ b/packages/chat/src/react/useChatSession/useChatSession.test.tsx
@@ -1007,6 +1007,74 @@ describe("useChatSession", () => {
test("keeps the cached transcript when the journal cannot be read", async () => {
expect(await cacheAndFailLoad("journal_missing")).toBeGreaterThan(0);
});
+
+ test("shows the cached transcript and loads the history again while the host cannot read it", async () => {
+ const stack = await startStack();
+ const first = stack.makeClient();
+ const firstView = render();
+ await domWaitFor(() => expect(session().status).toBe("ready"));
+ act(() => {
+ session().sendPrompt([{ type: "text", text: "hello" }]);
+ });
+ await domWaitFor(() =>
+ expect(session().snapshot.session?.status).toBe("idle"),
+ );
+ const cachedItems = session().snapshot.items.size;
+ expect(cachedItems).toBeGreaterThan(0);
+ firstView.unmount();
+ first.close();
+
+ let readable = false;
+ const flaky: ChatTransport = new Proxy(stack.transport, {
+ get: (target, prop, receiver) => {
+ if ((prop === "getOutline" || prop === "getItems") && !readable) {
+ return async () => ({ ok: false, reset: "journal_missing" });
+ }
+ return Reflect.get(target, prop, receiver);
+ },
+ });
+ const manual = createManualWait();
+ const client = stack.makeClient({ transport: flaky, wait: manual.wait });
+ const view = render();
+
+ await domWaitFor(() => expect(session().historyUnavailable).toBe(true));
+ expect(session().status).toBe("ready");
+ expect(session().snapshot.items.size).toBe(cachedItems);
+
+ readable = true;
+ await domWaitFor(() => {
+ act(() => manual.flush());
+ expect(session().historyUnavailable).toBe(false);
+ });
+ expect(session().snapshot.items.size).toBe(cachedItems);
+ view.unmount();
+ client.close();
+ await stack.runtime.dispose();
+ });
+
+ test("stops asking for an unreadable history once the chat closes", async () => {
+ const stack = await startStack();
+ const unreadable: ChatTransport = new Proxy(stack.transport, {
+ get: (target, prop, receiver) =>
+ prop === "getOutline" || prop === "getItems"
+ ? async () => ({ ok: false, reset: "journal_missing" })
+ : Reflect.get(target, prop, receiver),
+ });
+ const manual = createManualWait();
+ const client = stack.makeClient({
+ transport: unreadable,
+ wait: manual.wait,
+ });
+ const view = render();
+ await domWaitFor(() => expect(session().historyUnavailable).toBe(true));
+ expect(session().snapshot.session?.harness).toBe(FAKE_HARNESS);
+
+ view.unmount();
+ client.close();
+ act(() => manual.flush());
+ expect(manual.pendingCount()).toBe(0);
+ await stack.runtime.dispose();
+ });
});
test("a chat subscribes to background steps by default", () => {
diff --git a/packages/chat/src/react/useChatSession/useChatSession.ts b/packages/chat/src/react/useChatSession/useChatSession.ts
index f202b246e04..4f48e5d9be0 100644
--- a/packages/chat/src/react/useChatSession/useChatSession.ts
+++ b/packages/chat/src/react/useChatSession/useChatSession.ts
@@ -66,9 +66,45 @@ const defaultWait: Wait = (callback, delayMs) => {
};
const SEED_TIMEOUT_MS = 10_000;
+const HISTORY_RETRY_MAX_MS = 60_000;
const MAX_BODIES_PER_REQUEST = 100;
const MAX_BODY_ATTEMPTS = 3;
+function timedWith(wait: Wait) {
+ return (request: Promise) =>
+ new Promise((resolve, reject) => {
+ const cancelTimeout = wait(
+ () => reject(new Error("timed out")),
+ SEED_TIMEOUT_MS,
+ );
+ request.then(
+ (value) => {
+ cancelTimeout();
+ resolve(value);
+ },
+ (error: unknown) => {
+ cancelTimeout();
+ reject(error);
+ },
+ );
+ });
+}
+
+function withSessionRow(
+ snapshot: SessionSnapshot,
+ row: NonNullable,
+): SessionSnapshot {
+ return {
+ ...snapshot,
+ session: {
+ ...snapshot.session,
+ status: row.status,
+ harness: row.harness,
+ ...(row.title ? { title: row.title } : {}),
+ },
+ };
+}
+
type Seed =
| { kind: "outline"; snapshot: SessionSnapshot }
| { kind: "page"; envelopes: Envelope[]; nextBefore: Cursor | null };
@@ -171,6 +207,7 @@ export type ChatSession = {
status: ChatSessionStatus;
connection: StreamStatus;
unreachable: boolean;
+ historyUnavailable: boolean;
outbox: OutboxEntry[];
hasOlder: boolean;
requestItemBodies(itemIds: readonly string[]): void;
@@ -228,6 +265,7 @@ export function useChatSession(options: UseChatSessionOptions): ChatSession {
const [status, setStatus] = useState("loading");
const [connection, setConnection] = useState("connecting");
const [unreachable, setUnreachable] = useState(false);
+ const [historyUnavailable, setHistoryUnavailable] = useState(false);
const [outboxEntries, setOutboxEntries] = useState([]);
const [hasOlder, setHasOlder] = useState(false);
@@ -245,6 +283,7 @@ export function useChatSession(options: UseChatSessionOptions): ChatSession {
const resyncBufferRef = useRef(null);
const clientRef = useRef(client);
clientRef.current = client;
+ const historyRecoveredRef = useRef<(() => void) | null>(null);
const outbox = useMemo(
() =>
@@ -395,23 +434,31 @@ export function useChatSession(options: UseChatSessionOptions): ChatSession {
);
const resync = useCallback(
- async (afterReset = false) => {
+ async (afterReset = false): Promise => {
if (resyncingRef.current) {
if (afterReset) resyncAgainRef.current = true;
- return;
+ return false;
}
resyncingRef.current = true;
+ let applied = false;
try {
do {
resyncAgainRef.current = false;
resyncBufferRef.current = [];
- const seed = await fetchSeed(client, pageSize).catch(() => null);
- if (clientRef.current !== client) return;
+ const seed = await fetchSeed(
+ client,
+ pageSize,
+ timedWith(waitRef.current),
+ ).catch(() => null);
+ if (clientRef.current !== client) return false;
const seeded = seed
? applySeed(seed, true, resyncBufferRef.current)
: null;
+ applied = seed !== null;
if (seeded?.pendingReset) resyncAgainRef.current = true;
} while (resyncAgainRef.current);
+ if (applied) historyRecoveredRef.current?.();
+ return applied;
} finally {
resyncingRef.current = false;
resyncBufferRef.current = null;
@@ -431,6 +478,7 @@ export function useChatSession(options: UseChatSessionOptions): ChatSession {
setStatus("loading");
setUnreachable(false);
+ setHistoryUnavailable(false);
setConnection("connecting");
const primed = takePrimedSnapshot(client.sessionId);
const cached = cachedSnapshot(client.sessionId);
@@ -441,34 +489,45 @@ export function useChatSession(options: UseChatSessionOptions): ChatSession {
pendingRef.current = [];
let cancelRetry: (() => void) | null = null;
- const retry = (attempt: number) => {
- const delayMs = Math.min(
+ const backoffMs = (attempt: number) =>
+ Math.min(
DEFAULT_BACKOFF_INITIAL_MS * 2 ** attempt,
DEFAULT_BACKOFF_MAX_MS,
);
+ const retry = (attempt: number) => {
cancelRetry = waitRef.current(() => {
cancelRetry = null;
void seed(attempt + 1);
- }, delayMs);
+ }, backoffMs(attempt));
+ };
+ let historyPending = false;
+ const historyRecovered = () => {
+ if (!historyPending) return;
+ historyPending = false;
+ loaded = true;
+ cancelRetry?.();
+ cancelRetry = null;
+ setHistoryUnavailable(false);
+ };
+ historyRecoveredRef.current = historyRecovered;
+ const retryHistory = (attempt: number) => {
+ historyPending = true;
+ setHistoryUnavailable(true);
+ cancelRetry = waitRef.current(
+ () => {
+ cancelRetry = null;
+ void resync().then(() => {
+ if (!cancelled && historyPending) retryHistory(attempt + 1);
+ });
+ },
+ Math.min(
+ DEFAULT_BACKOFF_INITIAL_MS * 2 ** attempt,
+ HISTORY_RETRY_MAX_MS,
+ ),
+ );
};
- const timed = (request: Promise) =>
- new Promise((resolve, reject) => {
- const cancelTimeout = waitRef.current(
- () => reject(new Error("timed out")),
- SEED_TIMEOUT_MS,
- );
- request.then(
- (value) => {
- cancelTimeout();
- resolve(value);
- },
- (error: unknown) => {
- cancelTimeout();
- reject(error);
- },
- );
- });
+ const timed = timedWith(waitRef.current);
const seed = async (attempt: number) => {
let session: InitialLoad[0];
@@ -489,13 +548,22 @@ export function useChatSession(options: UseChatSessionOptions): ChatSession {
cached ? withCachedBodies(seed, cached) : seed,
false,
);
- } else {
- if (!session.session) forgetSnapshot(client.sessionId);
+ } else if (!session.session) {
+ forgetSnapshot(client.sessionId);
setSnapshot(emptySnapshot());
+ } else {
+ const row = session.session;
+ const otherEpoch =
+ cached?.cursor != null && cached.cursor.epoch !== row.epoch;
+ if (otherEpoch) forgetSnapshot(client.sessionId);
+ setSnapshot((prev) =>
+ withSessionRow(otherEpoch ? emptySnapshot() : prev, row),
+ );
}
loaded = seed !== null;
setStatus("ready");
subscribe(seeded?.cursor ?? session.cursor);
+ if (!seed && session.session) retryHistory(0);
};
const subscribe = (since: Cursor | null) => {
stream = client.subscribe({
@@ -524,6 +592,9 @@ export function useChatSession(options: UseChatSessionOptions): ChatSession {
}
return () => {
+ if (historyRecoveredRef.current === historyRecovered) {
+ historyRecoveredRef.current = null;
+ }
if (loaded && !snapshotRef.current.pendingReset) {
cacheSnapshot(client.sessionId, snapshotRef.current);
}
@@ -635,6 +706,7 @@ export function useChatSession(options: UseChatSessionOptions): ChatSession {
status,
connection,
unreachable,
+ historyUnavailable,
outbox: outboxEntries,
hasOlder,
requestItemBodies,
diff --git a/packages/i18n/locales/cs/messages.po b/packages/i18n/locales/cs/messages.po
index 460f5e0118b..873e1345eef 100644
--- a/packages/i18n/locales/cs/messages.po
+++ b/packages/i18n/locales/cs/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Cesty vzdáleného pracovního prostoru nejde otevřít ve Finderu"
msgid "Can't reach the host"
msgstr "Host není dostupný"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Nelze se spojit s hostitelem tohoto pracovního prostoru. Zkouším znovu…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Nelze vrátit, dokud v tomto pracovním prostoru pracuje chat."
@@ -6182,6 +6185,9 @@ msgstr "Nepodařilo se načíst komentáře k revizi"
msgid "Couldn't load runs"
msgstr "Běhy se nepodařilo načíst"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Zprávy tohoto chatu se nepodařilo načíst. Zkouším znovu…"
+
msgid "Couldn't load this run's payload."
msgstr "Data tohoto běhu se nepodařilo načíst."
diff --git a/packages/i18n/locales/de/messages.po b/packages/i18n/locales/de/messages.po
index 61efe3ea11f..e4dce760e78 100644
--- a/packages/i18n/locales/de/messages.po
+++ b/packages/i18n/locales/de/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Pfade aus Remote-Arbeitsbereichen lassen sich nicht im Finder öffnen"
msgid "Can't reach the host"
msgstr "Host nicht erreichbar"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Der Host dieses Arbeitsbereichs ist nicht erreichbar. Neuer Versuch…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Rückgängig machen geht nicht, während ein Chat in diesem Arbeitsbereich arbeitet."
@@ -6182,6 +6185,9 @@ msgstr "Review-Kommentare konnten nicht geladen werden"
msgid "Couldn't load runs"
msgstr "Ausführungen konnten nicht geladen werden"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Die Nachrichten dieses Chats konnten nicht geladen werden. Neuer Versuch…"
+
msgid "Couldn't load this run's payload."
msgstr "Die Nutzlast dieser Ausführung konnte nicht geladen werden."
diff --git a/packages/i18n/locales/en/messages.po b/packages/i18n/locales/en/messages.po
index cdfa100587d..fe82be27225 100644
--- a/packages/i18n/locales/en/messages.po
+++ b/packages/i18n/locales/en/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Can't open remote workspace paths in Finder"
msgid "Can't reach the host"
msgstr "Can't reach the host"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Can't reach this workspace's host. Retrying…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Can't undo while a chat in this workspace is working."
@@ -6182,6 +6185,9 @@ msgstr "Couldn't load review comments"
msgid "Couldn't load runs"
msgstr "Couldn't load runs"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Couldn't load this chat's messages. Retrying…"
+
msgid "Couldn't load this run's payload."
msgstr "Couldn't load this run's payload."
diff --git a/packages/i18n/locales/es/messages.po b/packages/i18n/locales/es/messages.po
index 219c2e6f9dd..2cf65996701 100644
--- a/packages/i18n/locales/es/messages.po
+++ b/packages/i18n/locales/es/messages.po
@@ -4000,6 +4000,9 @@ msgstr "No se pueden abrir rutas de espacios de trabajo remotos en Finder"
msgid "Can't reach the host"
msgstr "No se puede conectar con el host"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "No se puede conectar con el host de este espacio de trabajo. Reintentando…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "No se puede deshacer mientras un chat de este espacio de trabajo está trabajando."
@@ -6182,6 +6185,9 @@ msgstr "No se pudieron cargar los comentarios de la revisión"
msgid "Couldn't load runs"
msgstr "No se pudieron cargar las ejecuciones"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "No se pudieron cargar los mensajes de este chat. Reintentando…"
+
msgid "Couldn't load this run's payload."
msgstr "No se pudo cargar la carga útil de esta ejecución."
diff --git a/packages/i18n/locales/fr/messages.po b/packages/i18n/locales/fr/messages.po
index a4eed160858..2ed16613847 100644
--- a/packages/i18n/locales/fr/messages.po
+++ b/packages/i18n/locales/fr/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Impossible d'ouvrir les chemins d'un espace de travail distant dans le F
msgid "Can't reach the host"
msgstr "Impossible de joindre l'hôte"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Impossible de joindre l'hôte de cet espace de travail. Nouvelle tentative…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Impossible d'annuler pendant qu'un chat de cet espace de travail travaille."
@@ -6182,6 +6185,9 @@ msgstr "Impossible de charger les commentaires de revue"
msgid "Couldn't load runs"
msgstr "Impossible de charger les exécutions"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Impossible de charger les messages de ce chat. Nouvelle tentative…"
+
msgid "Couldn't load this run's payload."
msgstr "Impossible de charger la charge utile de cette exécution."
diff --git a/packages/i18n/locales/id/messages.po b/packages/i18n/locales/id/messages.po
index 17ce456c130..7af7d93639c 100644
--- a/packages/i18n/locales/id/messages.po
+++ b/packages/i18n/locales/id/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Tidak bisa membuka path workspace jarak jauh di Finder"
msgid "Can't reach the host"
msgstr "Tidak dapat menjangkau host"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Tidak dapat menjangkau host workspace ini. Mencoba lagi…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Tidak bisa dibatalkan selagi chat di workspace ini bekerja."
@@ -6182,6 +6185,9 @@ msgstr "Tidak bisa memuat komentar review"
msgid "Couldn't load runs"
msgstr "Tidak dapat memuat run"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Tidak dapat memuat pesan chat ini. Mencoba lagi…"
+
msgid "Couldn't load this run's payload."
msgstr "Tidak dapat memuat payload run ini."
diff --git a/packages/i18n/locales/it/messages.po b/packages/i18n/locales/it/messages.po
index 35e5685c296..65c357bfa80 100644
--- a/packages/i18n/locales/it/messages.po
+++ b/packages/i18n/locales/it/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Impossibile aprire i percorsi di un workspace remoto nel Finder"
msgid "Can't reach the host"
msgstr "Impossibile raggiungere l'host"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Impossibile raggiungere l'host di questo workspace. Nuovo tentativo…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Impossibile annullare mentre una chat in questo workspace sta lavorando."
@@ -6182,6 +6185,9 @@ msgstr "Impossibile caricare i commenti di revisione"
msgid "Couldn't load runs"
msgstr "Impossibile caricare le esecuzioni"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Impossibile caricare i messaggi di questa chat. Nuovo tentativo…"
+
msgid "Couldn't load this run's payload."
msgstr "Impossibile caricare il payload di questa esecuzione."
diff --git a/packages/i18n/locales/ja/messages.po b/packages/i18n/locales/ja/messages.po
index 74d65f8a3f5..bb311469d29 100644
--- a/packages/i18n/locales/ja/messages.po
+++ b/packages/i18n/locales/ja/messages.po
@@ -4000,6 +4000,9 @@ msgstr "リモートワークスペースのパスはFinderで開けません"
msgid "Can't reach the host"
msgstr "ホストに接続できません"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "このワークスペースのホストに接続できません。再試行中…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "このワークスペースでチャットが作業中のため取り消せません。"
@@ -6182,6 +6185,9 @@ msgstr "レビューコメントを読み込めませんでした"
msgid "Couldn't load runs"
msgstr "実行履歴を読み込めませんでした"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "このチャットのメッセージを読み込めませんでした。再試行中…"
+
msgid "Couldn't load this run's payload."
msgstr "この実行のペイロードを読み込めませんでした。"
diff --git a/packages/i18n/locales/ko/messages.po b/packages/i18n/locales/ko/messages.po
index 396ee342947..26a753a08c5 100644
--- a/packages/i18n/locales/ko/messages.po
+++ b/packages/i18n/locales/ko/messages.po
@@ -4000,6 +4000,9 @@ msgstr "원격 워크스페이스 경로는 Finder에서 열 수 없습니다"
msgid "Can't reach the host"
msgstr "호스트에 연결할 수 없습니다"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "이 워크스페이스의 호스트에 연결할 수 없습니다. 다시 시도하는 중…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "이 워크스페이스에서 채팅이 작업 중이어서 실행 취소할 수 없습니다."
@@ -6182,6 +6185,9 @@ msgstr "리뷰 코멘트를 불러오지 못했습니다"
msgid "Couldn't load runs"
msgstr "실행 기록을 불러오지 못했습니다"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "이 채팅의 메시지를 불러오지 못했습니다. 다시 시도하는 중…"
+
msgid "Couldn't load this run's payload."
msgstr "이 실행의 페이로드를 불러오지 못했습니다."
diff --git a/packages/i18n/locales/nl/messages.po b/packages/i18n/locales/nl/messages.po
index 20e934c4f67..da78eea242d 100644
--- a/packages/i18n/locales/nl/messages.po
+++ b/packages/i18n/locales/nl/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Paden van externe werkruimtes kunnen niet in Finder worden geopend"
msgid "Can't reach the host"
msgstr "Host niet bereikbaar"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Kan de host van deze werkruimte niet bereiken. Opnieuw proberen…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Ongedaan maken kan niet terwijl een chat in deze werkruimte bezig is."
@@ -6182,6 +6185,9 @@ msgstr "Kan reviewopmerkingen niet laden"
msgid "Couldn't load runs"
msgstr "Kan runs niet laden"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Kan de berichten van deze chat niet laden. Opnieuw proberen…"
+
msgid "Couldn't load this run's payload."
msgstr "Kan de payload van deze run niet laden."
diff --git a/packages/i18n/locales/pl/messages.po b/packages/i18n/locales/pl/messages.po
index 5dc7afc082e..29f08939b5d 100644
--- a/packages/i18n/locales/pl/messages.po
+++ b/packages/i18n/locales/pl/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Nie można otwierać ścieżek zdalnego obszaru roboczego w Finderze"
msgid "Can't reach the host"
msgstr "Nie można połączyć się z hostem"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Nie można połączyć się z hostem tego obszaru roboczego. Ponawianie…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Nie można cofnąć, gdy czat w tym obszarze roboczym pracuje."
@@ -6182,6 +6185,9 @@ msgstr "Nie udało się wczytać komentarzy przeglądu"
msgid "Couldn't load runs"
msgstr "Nie udało się wczytać uruchomień"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Nie udało się wczytać wiadomości tego czatu. Ponawianie…"
+
msgid "Couldn't load this run's payload."
msgstr "Nie udało się wczytać ładunku tego uruchomienia."
diff --git a/packages/i18n/locales/pt-BR/messages.po b/packages/i18n/locales/pt-BR/messages.po
index 8fdedbd53b0..539fa480beb 100644
--- a/packages/i18n/locales/pt-BR/messages.po
+++ b/packages/i18n/locales/pt-BR/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Não dá para abrir caminhos de áreas de trabalho remotas no Finder"
msgid "Can't reach the host"
msgstr "Não foi possível acessar o host"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Não foi possível acessar o host desta área de trabalho. Tentando novamente…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Não é possível desfazer enquanto um chat nesta área de trabalho está trabalhando."
@@ -6182,6 +6185,9 @@ msgstr "Não foi possível carregar os comentários de revisão"
msgid "Couldn't load runs"
msgstr "Não foi possível carregar as execuções"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Não foi possível carregar as mensagens deste chat. Tentando novamente…"
+
msgid "Couldn't load this run's payload."
msgstr "Não foi possível carregar a carga útil desta execução."
diff --git a/packages/i18n/locales/ru/messages.po b/packages/i18n/locales/ru/messages.po
index fb6745dd1a1..554f18f85b6 100644
--- a/packages/i18n/locales/ru/messages.po
+++ b/packages/i18n/locales/ru/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Пути удалённых рабочих областей нельзя
msgid "Can't reach the host"
msgstr "Не удаётся связаться с хостом"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Не удаётся связаться с хостом этой рабочей области. Повторная попытка…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Нельзя отменить, пока чат в этой рабочей области работает."
@@ -6182,6 +6185,9 @@ msgstr "Не удалось загрузить комментарии ревью
msgid "Couldn't load runs"
msgstr "Не удалось загрузить запуски"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Не удалось загрузить сообщения этого чата. Повторная попытка…"
+
msgid "Couldn't load this run's payload."
msgstr "Не удалось загрузить полезную нагрузку этого запуска."
diff --git a/packages/i18n/locales/tr/messages.po b/packages/i18n/locales/tr/messages.po
index bd4bee9b575..471880e848e 100644
--- a/packages/i18n/locales/tr/messages.po
+++ b/packages/i18n/locales/tr/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Uzak çalışma alanı yolları Finder'da açılamaz"
msgid "Can't reach the host"
msgstr "Host'a ulaşılamıyor"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Bu çalışma alanının sunucusuna ulaşılamıyor. Yeniden deneniyor…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Bu çalışma alanında bir sohbet çalışırken geri alınamaz."
@@ -6182,6 +6185,9 @@ msgstr "İnceleme yorumları yüklenemedi"
msgid "Couldn't load runs"
msgstr "Çalıştırmalar yüklenemedi"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Bu sohbetin mesajları yüklenemedi. Yeniden deneniyor…"
+
msgid "Couldn't load this run's payload."
msgstr "Bu çalıştırmanın yükü yüklenemedi."
diff --git a/packages/i18n/locales/uk/messages.po b/packages/i18n/locales/uk/messages.po
index c397857269e..272a0e218ab 100644
--- a/packages/i18n/locales/uk/messages.po
+++ b/packages/i18n/locales/uk/messages.po
@@ -3994,6 +3994,9 @@ msgstr "Не вдається відкрити шляхи віддаленого
msgid "Can't reach the host"
msgstr "Хост недоступний"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Не вдається зв'язатися з хостом цього робочого простору. Повторна спроба…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Не можна скасувати, поки в цьому робочому просторі працює чат."
@@ -6176,6 +6179,9 @@ msgstr "Не вдалося завантажити коментарі рев'ю"
msgid "Couldn't load runs"
msgstr "Не вдалося завантажити запуски"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Не вдалося завантажити повідомлення цього чату. Повторна спроба…"
+
msgid "Couldn't load this run's payload."
msgstr "Не вдалося завантажити дані цього запуску."
diff --git a/packages/i18n/locales/vi/messages.po b/packages/i18n/locales/vi/messages.po
index 010e68574f9..aabd51ac654 100644
--- a/packages/i18n/locales/vi/messages.po
+++ b/packages/i18n/locales/vi/messages.po
@@ -4000,6 +4000,9 @@ msgstr "Không thể mở đường dẫn workspace từ xa trong Finder"
msgid "Can't reach the host"
msgstr "Không thể kết nối với host"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "Không thể kết nối tới máy chủ của workspace này. Đang thử lại…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "Không thể hoàn tác khi một chat trong workspace này đang làm việc."
@@ -6182,6 +6185,9 @@ msgstr "Không thể tải bình luận review"
msgid "Couldn't load runs"
msgstr "Không thể tải các lần chạy"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "Không thể tải tin nhắn của cuộc trò chuyện này. Đang thử lại…"
+
msgid "Couldn't load this run's payload."
msgstr "Không thể tải payload của lần chạy này."
diff --git a/packages/i18n/locales/zh-CN/messages.po b/packages/i18n/locales/zh-CN/messages.po
index 9fb1f8a470b..dc4604fa1e6 100644
--- a/packages/i18n/locales/zh-CN/messages.po
+++ b/packages/i18n/locales/zh-CN/messages.po
@@ -4000,6 +4000,9 @@ msgstr "无法在Finder中打开远程工作区路径"
msgid "Can't reach the host"
msgstr "无法连接主机"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "无法连接到此工作区的主机。正在重试…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "此工作区中有聊天正在工作,无法撤销。"
@@ -6182,6 +6185,9 @@ msgstr "无法加载审查评论"
msgid "Couldn't load runs"
msgstr "无法加载运行记录"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "无法加载此聊天的消息。正在重试…"
+
msgid "Couldn't load this run's payload."
msgstr "无法加载此次运行的负载。"
diff --git a/packages/i18n/locales/zh-TW/messages.po b/packages/i18n/locales/zh-TW/messages.po
index bfeda7b87a1..7151791ae05 100644
--- a/packages/i18n/locales/zh-TW/messages.po
+++ b/packages/i18n/locales/zh-TW/messages.po
@@ -4000,6 +4000,9 @@ msgstr "無法在Finder中開啟遠端工作區路徑"
msgid "Can't reach the host"
msgstr "無法連線至主機"
+msgid "Can't reach this workspace's host. Retrying…"
+msgstr "無法連線到此工作區的主機。正在重試…"
+
msgid "Can't undo while a chat in this workspace is working."
msgstr "此工作區中有聊天正在工作,無法撤銷。"
@@ -6182,6 +6185,9 @@ msgstr "無法載入審查評論"
msgid "Couldn't load runs"
msgstr "無法載入執行紀錄"
+msgid "Couldn't load this chat's messages. Retrying…"
+msgstr "無法載入此聊天的訊息。正在重試…"
+
msgid "Couldn't load this run's payload."
msgstr "無法載入此次執行的酬載。"
From 530029f07ae0576a0c94875ddf240fd9b65f4558 Mon Sep 17 00:00:00 2001
From: Harshith Mullapudi <17528887+harshithmullapudi@users.noreply.github.com>
Date: Wed, 18 Nov 2026 16:03:54 +0000
Subject: [PATCH 2/3] fix(chat): retry every failed history read, give up after
a while, and keep the notice out of the transcript
Review follow-ups for the blank chat fix:
- A resync after a stream reset or an epoch change that fails now goes to
the same history retry as the first load, so the chat no longer freezes
with no notice.
- The retry stops after 8 attempts (about 40 s) and shows "Couldn't load
this chat's messages." with a Retry button, so a chat whose journal
cannot be read does not replay it on the host for as long as it is open.
- A resync from a load that was replaced does not apply its seed.
- A page that recovers into another epoch drops the old epoch's items.
- A rejected or timed-out getItems is a missing seed, not an unreachable
host, so the chat still subscribes and can send.
- While the history is not confirmed, a pending approval in the kept
transcript does not capture a new prompt.
- The notice is a row above the transcript, so it does not cover the
first message.
---
.../components/SessionView/SessionView.tsx | 11 +-
.../HistoryNotice/HistoryNotice.tsx | 36 +++++
.../components/HistoryNotice/index.ts | 1 +
.../TranscriptLoadState.tsx | 12 --
.../useChatSession/useChatSession.test.tsx | 84 +++++++++++-
.../react/useChatSession/useChatSession.ts | 129 ++++++++++++------
packages/i18n/locales/cs/messages.po | 3 +
packages/i18n/locales/de/messages.po | 3 +
packages/i18n/locales/en/messages.po | 3 +
packages/i18n/locales/es/messages.po | 3 +
packages/i18n/locales/fr/messages.po | 3 +
packages/i18n/locales/id/messages.po | 3 +
packages/i18n/locales/it/messages.po | 3 +
packages/i18n/locales/ja/messages.po | 3 +
packages/i18n/locales/ko/messages.po | 3 +
packages/i18n/locales/nl/messages.po | 3 +
packages/i18n/locales/pl/messages.po | 3 +
packages/i18n/locales/pt-BR/messages.po | 3 +
packages/i18n/locales/ru/messages.po | 3 +
packages/i18n/locales/tr/messages.po | 3 +
packages/i18n/locales/uk/messages.po | 3 +
packages/i18n/locales/vi/messages.po | 3 +
packages/i18n/locales/zh-CN/messages.po | 3 +
packages/i18n/locales/zh-TW/messages.po | 3 +
24 files changed, 267 insertions(+), 60 deletions(-)
create mode 100644 apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/HistoryNotice/HistoryNotice.tsx
create mode 100644 apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/HistoryNotice/index.ts
diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/SessionView.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/SessionView.tsx
index daf3ec614a6..2f46e571399 100644
--- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/SessionView.tsx
+++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/SessionView.tsx
@@ -75,6 +75,7 @@ import {
type WorkDrawerHandle,
} from "../WorkDrawer";
import { ComposerChips } from "./components/ComposerChips";
+import { HistoryNotice } from "./components/HistoryNotice";
import { TranscriptLoadState } from "./components/TranscriptLoadState";
import {
type SwitchAccount,
@@ -99,6 +100,7 @@ import { subagentsInTurn } from "./utils/subagentsInTurn";
const RESUME_FOLLOW_PX = 24;
const NO_COMMANDS: AvailableCommand[] = [];
const NO_CONFIG_OPTIONS: SessionConfigOption[] = [];
+const NO_APPROVALS: ReturnType = [];
function contentText(content: UserContent[]): string {
return userMessageText({ content });
@@ -472,7 +474,7 @@ export function SessionView({
[sendPrompt],
);
const onSend = useMainSend({
- approvals,
+ approvals: session.history === "loaded" ? approvals : NO_APPROVALS,
holdPrompt,
loaded,
onAnswerFailed,
@@ -709,6 +711,12 @@ export function SessionView({
{setupEnvironment && (
)}
+ {session.history !== "loaded" && (
+
+ )}
diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/HistoryNotice/HistoryNotice.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/HistoryNotice/HistoryNotice.tsx
new file mode 100644
index 00000000000..ad748fb739c
--- /dev/null
+++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/SessionView/components/HistoryNotice/HistoryNotice.tsx
@@ -0,0 +1,36 @@
+import { Trans } from "@lingui/react/macro";
+import { Button } from "@superset/ui/button";
+import { Spinner } from "@superset/ui/spinner";
+
+export function HistoryNotice({
+ failed,
+ onRetry,
+}: {
+ failed: boolean;
+ onRetry: () => void;
+}) {
+ return (
+