feat: add opt-in optimized sync retention - #368
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 23, 2026, 8:28 PM ET / August 24, 2026, 00:28 UTC. ClawSweeper reviewWhat this changesThe PR adds an account-persisted optimized-sync policy that bounds retained chats and messages, limits pairing history, and disables selected local persistence by default. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 7 items remain Keep this PR open: it adds a useful opt-in retention feature, but partial tuning silently resets persisted boolean preferences and can subsequently delete call or Status rows. It also needs maintainer product sponsorship and real after-fix behavior proof. Priority: P2 Review scores
Verification
How this fits togetherwacli authentication and sync commands receive WhatsApp history and live events, then persist an account-local SQLite index used by CLI search and history. The new policy sits between those incoming events and local message, media, call, and Status storage. flowchart LR
A[WhatsApp account] --> B[Auth and sync commands]
B --> C[Persisted optimization policy]
C --> D[History and live events]
D --> E[Retention decision]
E --> F[SQLite local index]
F --> G[CLI search and history]
Decision needed
Why: This creates new persisted configuration, cleanup semantics, and a broad CLI surface; code correctness cannot decide whether that is the intended core product boundary. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: If maintainers want optimized retention in core, preserve every untouched persisted option, add regression coverage for partial updates, and provide redacted populated-store proof before merging. Do we have a high-confidence way to reproduce the issue? Yes for the review finding: start with a saved policy that enables calls or Statuses, then pass only --max-chats; the resolver’s default boolean values overwrite those saved settings. Is this the best way to solve the issue? No: partial tuning must retain all persisted options whose flags were not supplied, rather than reapplying Cobra defaults to them. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 97e14efdf91a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Summary
--optimizedsync policy for bounded large-account indexes--confirmbefore first cleanup of a populated local storeVerification
pnpm testpnpm buildpnpm format:checkpnpm lintgit diff --checkNotes
Existing local data is pruned only after explicit optimized activation; no WhatsApp phone history is changed.