Skip to content

perf(storage): reduce retained thread and cache data - #1055

Merged
nixuuu merged 1 commit into
devfrom
fix/replication-log-retention
Nov 20, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/replication-log-retention

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 20, 2026

Copy link
Copy Markdown
Member

Changes

  • Expire old, unpublished events in the contiguous replication prefix while honoring active leases and the 10,000-record replay window. Expired clients can recover from source history.
  • Deduplicate exact transcript payloads, including tool JSON and diffs. Preserve full-content replay and reuse the existing content reference when a large preview needs further trimming.
  • Sweep the worker's preview cache hourly and at startup. Keep files referenced by pending journal events or in-flight writes.
  • Cap Electron's HTTP disk cache at 64 MiB. Fix a packaged Desktop regression where an origin captured by the bundled adapter caused valid forms to return HTTP 403 in Local or Remote mode. Foreign origins still receive HTTP 403.
  • Recover Codex turns from native archived and Zstandard-compressed rollouts. Automatic compression remains deferred while import and CLI rollback support are incomplete.

The PostgreSQL 17 fixture with 600 items used 21.74 MiB across the three measured relations, down from 26.08 MiB (16.6%). An isolated Electron run retained 60 MiB after receiving 152 MiB of cacheable data. Both measurements are from test fixtures.

Verification

  • Ran 460 non-live integration and focused test files on isolated databases. The first run had 2,880 passes, 12 skips and 13 failures. All 13 failing cases passed on focused reruns after fixture isolation and link-readiness fixes or when rerun without the parallel load.
  • Reran 34 tests for first and subsequent prompts, file and image delivery to Codex, Claude and Grok stand-ins, linked attachment reads, and client continuity.
  • In a real browser against the test stack, created a thread with a prompt, TXT and PNG, verified the worker received both files, and reopened the conversation. Also verified a follow-up with an attachment and opened the text and image previews.
  • Built the Linux x64 Desktop bundle. All five packaged-runtime tests and the Electron shell smoke passed.
  • Targeted typechecks, lint and formatting passed. GitHub CI will run the repository-wide gates for this revision.

The mobile Connect transport and history tests ran in the integration suite. The changed form-origin handling and HTTP disk cache are Electron-specific. Native iOS and Android UI and live provider calls were outside this local run. No user-facing copy changed.

Refs: #864
Refs: #1051

@nixuuu
nixuuu enabled auto-merge (squash) November 20, 2026 14:21
@nixuuu
nixuuu merged commit eeee4fc into dev Nov 20, 2026
16 checks passed
@nixuuu
nixuuu deleted the fix/replication-log-retention branch November 20, 2026 14:29
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