Repository navigation
Render the sidebar and opened chats from the client cache first (851-4468) - #1487
Merged
Merged
Conversation
dylanplayer
changed the base branch from
main
to
dylan/851-4468-client-database-cache-what-the-apps-have-seen
November 26, 2026 02:09
dylanplayer
force-pushed
the
dylan/851-4468-client-database-cache-what-the-apps-have-seen
branch
2 times, most recently
from
November 26, 2026 21:51
c350948 to
b9923bd
Compare
dylanplayer
force-pushed
the
dylan/851-4468-read-client-cache
branch
from
November 26, 2026 21:53
abab5ae to
9923857
Compare
Base automatically changed from
dylan/851-4468-client-database-cache-what-the-apps-have-seen
to
main
November 27, 2026 04:34
The sidebar loads from the cache tables at launch (the old snapshot blobs are imported once and removed), and an existing chat shows its cached transcript as soon as it is opened, before and without a connection. The live connection then replaces it. On iOS a chat whose machine is unreachable now shows its cached transcript instead of the connecting screen. The old per-chat transcript file cache is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The turn-end audit runs only after the page refresh succeeds, so a failed fetch doesn't report a false mismatch. Tests that relaunch a navigation store now share a client cache across the relaunch, since the sidebar no longer persists through the old snapshot blobs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the client cache has content, the Mac's launch cover steps aside right away instead of waiting for this Mac's server, so the app opens into what it last knew; server state shows through the existing inline banner and Syncing indicator. Attachments are served from the cache before the network, so an image opened before still shows in the lightbox while its machine is unreachable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
dylanplayer
force-pushed
the
dylan/851-4468-read-client-cache
branch
from
November 27, 2026 04:37
9923857 to
0f74c4c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes 851-4468 (part 2 of 2). Stacked on #1478: review only the commits after it.
The Mac and iOS apps now render from the client cache first. The sidebar and workspace list load from the cache tables at launch, and opening a chat you've seen shows its cached transcript immediately, before and without any connection. The live connection then replaces it in place. There's no switch: it's always on, and alpha is the safety net.
What changed
NavigationCacheStoreloads and saves throughClientCache(thecache_*tables from Write what the apps receive into a client cache (851-4468) #1478) instead of the per-machine JSON blobs inclient_values.LegacyNavigationCacheImport).SessionControllershows the cached transcript as soon as an existing chat is configured (showCachedTranscript), not only inside the connect path.replaceUnreachableClient).LaunchGate,hasCachedContent). Connection state shows only through what main already has: the inline "Reconnecting…" line and the sidebar's Syncing indicator. With an empty cache the cover behaves as before.CodevisorServerClient.fileData/filePreviewread the cached bytes first and only fetch on a miss.TranscriptPageCache(30 files in Caches) is removed and its directory is cleaned up at launch.No server or protocol changes, and no UI redesign: every screen is an existing one. The only visible difference is that cached content appears where a connecting screen or the Mac launch cover used to.
Disposable, wipe and refill
The rules from #1478 still hold, and now they matter at read time too. A cache from another schema version is dropped. A row that fails to decode at launch rebuilds the whole cache. In both cases the app refills from the machines, so the worst case is the sidebar loading from the network as it did before.
Tophat
Real Mac dev app and iOS simulator (
bun run dev:ios), real Codex sign-in, no mocks. Screenshots are on the Linear ticket.Offline (the before/after). Dev server and dev cloud stopped (the Mac's machine unreachable, nothing for the iPhone to reach), iPhone app cold-launched:
Mac offline cold launch (the before/after). The dev app was quit, then started on its own with no server and no cloud: the
CodevisorUsesStandaloneServerpref makes it wait for an external server, and nothing was listening. The real server was started later by hand from the same data.codevisor-icon.png)bun run devlaunch. The launch dropped every cache table and the cached files, and kept the app's 4 preferences and 30 values. The sidebar refilled to 345 workspaces / 346 chats (Client cache matches sidebar of local). Reopening "Five fruits" and its image re-cached the transcript and the 28 KB original. This found a bug fixed in Write what the apps receive into a client cache (851-4468) #1478: a wipe used to leave the cached files on disk, outside the size budget.Server frozen (dev server sent SIGSTOP; tunnel up, every request hangs):
Large account. 300 workspaces plus a 30-turn real Codex chat, created through the dev server's own API:
SidebarWorkspaceSection.body/ProjectGroup.grouping(debug build), with no cache or SQLite frames on the main thread.Wiped / mismatched / corrupt cache:
cache_chatspayload overwritten with invalid JSON. Next launch loggednavigation.load failed; rebuilding the cache, refilled to 342 / 343 with a matching audit, and kept the app's own preferences and values (4 / 30 rows).Regression checks:
sessions.sidebar_state = erroredin the server DB, from stopping the runner mid-session), not client state.Not covered in-app:
ClientCacheTranscriptTests.Tests
LaunchGateTests). An attachment opened before still loads when its machine is unreachable (ClientCacheTests).SessionControllerTranscriptCacheTests). Old sidebar blobs import once (ClientCacheTests).ClientCache,Launch,Navigation,SessionControllerandMachineControllersuites pass. In full parallel runs on this machine, a handful of timing tests (main-thread read checks inClientPreferences,CloudCredentialCache,CloudMachineKey*,ClientLaunchSnapshot, plusSessionModel's optimistic-send) fail intermittently. A cleanorigin/maincheckout fails the same set on the same machine, and main's CI Build is green, so they come from load, not this change.🤖 Generated with Claude Code