fix: stale session client ref and CUA smoke test improvements (#30)

* fix(sessions): use latestConnState.client to avoid stale reference after reconnect

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JKGMRpgihA4io2frodqLjt

* fix(cua): lru_cache get_screen_size, remove redundant if-matches guard, drop inner import re

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JKGMRpgihA4io2frodqLjt

* fix(cua): use center-x comparator for send button, defer screen_w fetch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JKGMRpgihA4io2frodqLjt

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Den
2026-06-20 03:38:06 -07:00
committed by GitHub
parent 9365a72e93
commit d6e84ff513
2 changed files with 20 additions and 14 deletions

View File

@@ -104,7 +104,7 @@ export const useSessions = create<SessionsState>((set, get) => ({
const scopeDir = sessionScopeDirectory(Boolean(latestConnState.activeConnection?.directory), home)
const listClient = scopeDir ? latestConnState.clientForDirectory(scopeDir) : latestConnState.client
const sessions = await (listClient || connState.client).session.list({ roots: true, limit: 50 })
const sessions = await (listClient || latestConnState.client!).session.list({ roots: true, limit: 50 })
set({ sessions, isLoading: false })
} catch (error) {
set({ error: "Failed to load sessions", isLoading: false })