From aec89c9bfb7891795861ca1fd432fe28bdee6f54 Mon Sep 17 00:00:00 2001 From: JJ Lee Date: Sat, 8 Aug 2026 19:59:04 -0400 Subject: [PATCH] fix(app): bug dock auto-dismisses when session vanishes externally (amicode#296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Layer 2 of the fix: a reactive liveness effect watches the synced session map — if the dock's current sessionID disappears (arm-failure cleanup by the extension, or any unexpected deletion), auto-dismiss silently. No new HTTP calls; rides the existing serverSync subscription. No toast (the extension already showed one). This prevents the composer from wedging in bug-report mode after the extension deletes a session that failed to arm. --- .../pages/session/composer/session-bug-dock.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/app/src/pages/session/composer/session-bug-dock.tsx b/packages/app/src/pages/session/composer/session-bug-dock.tsx index c4cde386c..b255dfd84 100644 --- a/packages/app/src/pages/session/composer/session-bug-dock.tsx +++ b/packages/app/src/pages/session/composer/session-bug-dock.tsx @@ -104,6 +104,21 @@ export function SessionBugDock() { // hard-deleted (they vanish from the map), filed ones archive (excluded) — // so a dismissed or terminal dock never re-opens from the watch. const serverSync = useServerSync() + + // Liveness watch (amicode#296): if the dock's session vanishes from the + // synced session map externally (arm-failure cleanup, or any unexpected + // deletion), auto-dismiss silently — no user action required, no wedged + // composer. No toast: the extension already showed an error. + createEffect(() => { + if (controller.phase() !== "chat") return + const id = controller.sessionID() + if (!id) return + const info = serverSync().session.data.info ?? {} + if (!(id in info)) { + controller.requestClose() + } + }) + createEffect(() => { if (!bugReportEnabled()) return if (bugDockController.phase() !== "closed") return