diff --git a/web/hwlab-cloud-web/app.ts b/web/hwlab-cloud-web/app.ts
index 9fe9002d..77087de1 100644
--- a/web/hwlab-cloud-web/app.ts
+++ b/web/hwlab-cloud-web/app.ts
@@ -290,6 +290,7 @@ initSessionSidebar();
initCopySessionIdButton();
initCodeAgentTimeoutControl();
initConversationScrollMemory();
+renderConversation();
initCommandBar();
initLiveBuildOverlay();
initWorkbenchLogout(el.logoutButton);
@@ -620,11 +621,11 @@ function refreshSessionSidebar(options = {}) {
}
function renderSessionSidebar() {
- const view = sessionTabsFromConversations(sessionSidebarConversations(), {
+ const view = safeSessionTabsView(() => sessionTabsFromConversations(sessionSidebarConversations(), {
selectedConversationId: state.conversationId,
selectedSessionId: state.sessionId,
activeTraceId: state.activeTraceId
- });
+ }));
replaceChildren(el.sessionTabs, ...view.tabs.map(sessionTabButton));
const pending = Boolean(state.sessionList.pendingAction);
el.sessionCreate.disabled = pending;
@@ -634,6 +635,17 @@ function renderSessionSidebar() {
el.sessionStatus.title = state.sessionList.error || state.sessionList.loadedAt || "session list not loaded";
}
+function safeSessionTabsView(factory) {
+ try {
+ const view = factory();
+ if (Array.isArray(view?.tabs)) return view;
+ state.sessionList.error = "session tabs renderer returned an invalid view";
+ } catch (error) {
+ state.sessionList.error = error?.message || String(error);
+ }
+ return { tabs: [], activeKey: null, activeConversation: null };
+}
+
function renderCopySessionIdButton(activeConversation) {
if (!el.copySessionId) return;
const conversationId = textOf(activeConversation?.conversationId) || textOf(state.conversationId);
diff --git a/web/hwlab-cloud-web/index.html b/web/hwlab-cloud-web/index.html
index e23167e1..f3a1eed4 100644
--- a/web/hwlab-cloud-web/index.html
+++ b/web/hwlab-cloud-web/index.html
@@ -208,7 +208,7 @@
-