Skip to content

Reduce memory usage for large clipboard histories - #49

Merged
bifrost-proxy merged 2 commits into
mainfrom
codex/reduce-memory-1.7.4
Aug 22, 2026
Merged

bifrost-proxy merged 2 commits into
mainfrom
codex/reduce-memory-1.7.4

Conversation

@bifrost-proxy

Copy link
Copy Markdown
Owner

Summary

  • replace full-content sync version keys with SHA-256 digests and migrate legacy state
  • build search bytes in an evictable mmap-backed index only on demand
  • stream incremental state and checkpoint persistence instead of encoding complete snapshots in memory
  • avoid full-text deduplication keys during merges
  • add deterministic large-history memory gates to CI and releases

Validation

  • 2,200 records / 51.9 MB text: 122.8 MB peak, 75.4 MB idle average, 86 ms first full search
  • fresh-device checkpoint restore: 125.9 MB peak, 74.4 MB current
  • 1,000-card strip: 96.8 MB max RSS, 18 cells, 3.29 s traversal
  • search input, Unicode/case-insensitive search, incremental sync/migration, deletion sync, isolated three-launch persistence
  • Universal 1.7.4 DMG signature, bundle, architecture, and three-launch packaged-app verification

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d863f34d05

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1015 to +1016
private func contentVersionKey(_ item: ClipItem) -> String {
contentDigest(item)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve legacy version keys in published checkpoints

When a 1.7.0–1.7.3 device shares iCloud data with this version, checkpoints now contain only digest-keyed historyVersions, while those older clients look up the legacy txt:/img:/... key and fall back to item.createdAt. If that older device already recorded a later metadata update for the same content, it rejects a newer title or metadata edit from the checkpoint as stale; after compaction deletes the covering batch and the device records the checkpoint as applied, the edit remains permanently missing even after upgrade. Keep legacy keys in the interoperable checkpoint format, or version the format and teach old/new readers how to preserve the actual record timestamp.

AGENTS.md reference: AGENTS.md:L92-L93

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 501957f4a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +56 to +57
), mappedBytes != MAP_FAILED else {
return nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset failed index builds before retrying search

When a large or unlimited history causes this new mmap allocation to return MAP_FAILED, the build task resolves to nil, but scheduleSearchIndexBuild clears searchIndexTask only after a successful build. Consequently, ensureSearchIndex() keeps awaiting the same completed nil-valued task for every subsequent non-empty query, leaving the full unfiltered history visible until the user clears search long enough for eviction or the history changes. Clear the failed task or provide a fallback so later queries can retry.

Useful? React with 👍 / 👎.

@bifrost-proxy
bifrost-proxy merged commit deae43b into main Aug 22, 2026
1 check passed
@bifrost-proxy
bifrost-proxy deleted the codex/reduce-memory-1.7.4 branch August 22, 2026 08:56
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.

1 participant