Skip to content

Cache-first loading plan, and iOS Home shows saved Recents while connecting - #516

Merged
sambitcreate merged 10 commits into
mainfrom
claude/project-thread-5ufzd9
Oct 17, 2026
Merged

sambitcreate merged 10 commits into
mainfrom
claude/project-thread-5ufzd9

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Requested by sbt · project thread

Before: on a cold launch, iOS Home said "No Chats Yet / Start a new Workspace chat to begin." behind a "Connecting to Aiden Agent…" overlay, even though the phone had the user's Recents saved. Scheduled Tasks, Usage and New chat were greyed out until the Mac answered, and tapping a Recents row waited on the network before opening.

After: Home shows saved Recents and Workspaces right away while the Mac connects. A first launch with nothing saved shows shaped skeleton rows, "empty" appears only after the Mac answers, and an unreachable Mac with nothing saved says so. Connecting is a quiet one-line hint. Scheduled Tasks opens from its cache, Usage opens to a skeleton until its data arrives, and New chat waits for the connection instead of being disabled. A Recents row with a saved transcript opens immediately, and the five newest transcripts are saved in the background after each refresh, except in Low Data Mode.

The PR also adds the cross-client plan (docs/plans/cache-first-loading-states-plan.md), which audits every blank or info-less loading state on iOS, Android and the desktop. The user approved it with three decisions: desktop read snapshots, recent-chat prefetch, and queued sends. This PR implements phase I1 and the cache-hit half of I2.

How:

  • AidenChatCache now stores the last workspace list for each paired Mac. Writes use the cache's write tokens, so writes reserved before an unpair purge, or older than the newest write, are dropped.
  • The coordinator loads that saved list on connect, and the home model reads saved summaries before checking the connection.
  • A small AidenReadPresentation decision function chooses between rows, skeleton, empty and failed.
  • New behavioral tests are in AidenCacheFirstHomeTests.

There is no protocol change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4
@sambitcreate sambitcreate self-assigned this Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4
Keep the workspace list per paired Mac so Home can project saved Recents
before the connection is up, read cached summaries before the connection
guard, and replace the connecting overlay, bare spinners and premature
empty states with shaped skeletons and a quiet connecting hint. Scheduled
Tasks and Usage stay usable while connecting, New chat waits for the
connection, Recents rows open from their saved transcript, and the five
newest transcripts are prefetched after a refresh outside Low Data Mode.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4
@sambitcreate sambitcreate changed the title Plan: cache-first loading states for iOS, Android and desktop Cache-first loading plan, and iOS Home shows saved Recents while connecting Oct 17, 2026
Seeding saved workspaces no longer bumps the live snapshot revision, the
held-image purge test ignores the saved workspace list, and the cache-first
home tests persist an earlier server answer so capabilities are negotiated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4
@sambitcreate
sambitcreate marked this pull request as ready for review October 17, 2026 01:56

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Three cache-first paths need correction before merging: background prefetch changes unread metadata, opening saved chats can miss post-connect reconciliation, and failed Usage reads leave a permanent loading state.

Reviewed changes across the complete PR, including the loading-state plan, iOS cache authority, Home presentation, and chat navigation lifecycle.

  • Cross-client plan: Records the approved cache-first behavior and phased iOS, Android, and desktop rollout.
  • Saved Home content: Persists per-installation workspace lists, hydrates saved Recents before connection, and introduces content/skeleton/empty/failure presentation with quieter connection status.
  • Navigation and prefetch: Enables cached Scheduled Tasks and pending Usage, waits for New chat readiness, opens saved transcripts immediately, and prefetches five recent transcripts outside Low Data Mode.
  • Verification: Reviewed the new behavioral tests; Swift syntax parsing and npm run test:ios-release passed locally. Native XCTest could not run on this Linux runner because xcodebuild is unavailable; hosted iOS verification was still running when inspected.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread ios/AidenOnTheGo/Features/Remote/AidenWorkspaceShellView.swift Outdated
Comment thread ios/AidenOnTheGo/Features/Remote/AidenWorkspaceShellView.swift
Comment thread ios/AidenOnTheGo/Features/Remote/AidenWorkspaceShellView.swift Outdated

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread ios/AidenOnTheGo/Features/Remote/AidenWorkspaceShellView.swift
@very-hermes-bot

very-hermes-bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Hermes review failed

Hermes could not produce a code-review verdict for this head SHA.

Engine: agy/gemini-3.8-flash-high
Review mode: full
Head: 242b4483bda27500e4cd2f5824ba776e20e83e89
Generated: 2026-10-17T02:45:13+00:00
Failure phase: engine

Safe summary:

Command '['/home/sambit1/.local/bin/agy', '--print-timeout', '30m0s', '--sandbox', '--add-dir', '/tmp/hermes-review-bot/aiden-agent-pr-516-242b4483bda2', '--model', 'gemini-3.8-flash-high', '--input-format', 'stream-json', '--output-format', 'stream-json', '--print', '']' timed out after 1920 seconds

Local logs: /home/sambit1/.hermes/logs/review-bot/aiden-agent.log

Prefetch keeps the Mac's unread and attention row state, a chat opened
from its saved copy reloads once the Mac connects, and a failed Usage read
shows a retry state instead of a permanent skeleton.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The reconnect refresh can be dropped when an earlier chat load is still in flight.

Reviewed changes since 74d4d40, including both follow-up commits through 8c9cd0a.

  • Preserved prefetch metadata. Saved background transcripts without overwriting unread or attention state, with cache-reopen coverage.
  • Added reconnect reconciliation. Triggered chat loading when the connection becomes ready; the overlapping-load case needs correction below.
  • Added Usage recovery. Presented failed first reads with Try Again instead of an indefinite skeleton.
  • Reset installation state. Cleared stale Home loading and error state when changing paired Macs, with a behavioral test.

Validation: iOS release checks and Swift syntax parsing passed. Native XCTest could not run on this Linux runner; hosted iOS build and simulator tests were still running when checked.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread ios/AidenOnTheGo/Features/Remote/AidenChatFeature.swift
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5dCdFaMEaw89th9uEujh4

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes since the prior review at 8c9cd0a, through 242b4483b.

  • Retained overlapping reloads. Added a cancellation-aware wait for the previous chat load to unwind before running the replacement, addressing the dropped reconnect refresh.
  • Covered replacement reads. Added a held-request test that cancels the initial load and verifies another transcript request, without assuming a fixed number of reads per load.
  • Updated implementation notes. Documented the reload serialization in the cache-first Home memory file.

Validation: npm run test:ios-release passed (20 Ruby tests and 30 Node tests), and Swift syntax parsing passed for both changed Swift files. Native XCTest could not run on this Linux runner because xcodebuild is unavailable; hosted iOS build and simulator tests were still running when checked.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@sambitcreate
sambitcreate merged commit cd847c1 into main Oct 17, 2026
20 of 21 checks passed
@sambitcreate
sambitcreate deleted the claude/project-thread-5ufzd9 branch October 17, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants