Skip to content

Defer lastAssistantPreview peek-migrate off Store constructor #644

Closed

Description

@currentbits

Follow-up to #639 lastAssistantPreview.

After the field is persisted, boot envelope parse is ~14 ms. On first upgrade every thread lacks lastAssistantPreview, so Store construct still skip-scans messagesByThread once to peek-migrate (~270 ms on the live 194 MB / 624-thread store). That puts the upgrade hitch on the constructor, before first paint.

Move that one-time peek off the constructor (on first threads:summaries, then save) so time-to-first-interactive-paint stays envelope-only even on upgrade. Do not hydrate messagesByThread.

Tests:

  • construct against a large fixture returns before any skip-scan
  • first summaries or a deferred migrate fills lastAssistantPreview
  • second boot is a no-op

Treat ~/Library/Application Support/Solenta/coder-store.json as read-only.

Activity

  1. currentbits commented on Aug 21, 2026

    @currentbits
    OwnerAuthor

    Implemented on coder/fork-fork-fork-boot-600-ms-synchronous-j-3f0c95 (on top of the #639 lazy-hydrate + lastAssistantPreview work).

    Store construct no longer peek-migrates lastAssistantPreview. First threads:summaries (or store.ensureLastAssistantPreviews()) skip-scans once, stamps the envelope, and save()s. Second boot is a no-op.

    Tests: construct of a 32-thread unmigrated fixture does not call _ensureMessagesIndexed; first summaries fills without hydrating; second boot does not skip-scan.

    Live store (read-only): 194 MB, 626 threads, envelope parse 14.9 ms, all 626 still lack the field. Did not construct Store against it.

  2. added
    plan:done
    and removed
    plan:doing
    on Aug 21, 2026
  3. currentbits commented on Aug 21, 2026

    @currentbits
    OwnerAuthor

    Implemented on this thread; peek-migrate is off the constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions