fix: keep auto-settle policy consistent across clients - #5290
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR fundamentally changes where the auto-settle policy is stored and read from (client → server), affecting how threads are classified across all connected clients. While backward compatibility is maintained, this architectural shift in configuration control is a significant behavioral change that warrants human review. You can customize Macroscope's approvability policy. Learn more. |
What Changed
thread.settle, and the server does not schedule settlement eventsWhy
Web/desktop read
sidebarAutoSettleAfterDaysfrom local client persistence, while mobile hard-coded the default of three days. A desktop configured for seven days and a mobile client connected to the same server could therefore put the same thread in different shelves.The existing server-settings RPC is already remotely writable and streamed to connected clients, so the policy now lives there. Explicit settle/un-settle remains the durable server lifecycle; crossing the inactivity threshold only changes the derived list classification. This avoids clients racing automatic settle commands and lets a policy change reclassify threads immediately.
The default remains three days. The legacy client field and exported names remain decodable for downgrade/source compatibility, but local values no longer drive upgraded clients; automatically importing whichever client connects first would recreate the same ownership race. In multi-environment lists, each backend owns its own policy rather than one client silently mirroring writes to other environments.
This establishes the ownership boundary that overlaps with #5141. Its proposed additional auto-settle controls should extend the server-owned policy rather than introducing separate web and mobile preferences.
UI Changes
No layout or interaction changes. The existing Beta setting now updates the primary environment and is read-only against older servers that do not advertise policy updates, so screenshots/video are not applicable.
Verification
vp test run packages/contracts/src/settings.test.ts apps/server/src/serverSettings.test.ts packages/client-runtime/src/state/threadSettled.test.ts apps/mobile/src/features/threads/threadListV2.test.ts— 269 passedgit diff --checkChecklist
Model: GPT-5.6-Sol | Harness: Codex in T3 Code
Note
Medium Risk
Changes thread list classification and settings ownership across web, mobile, and server; behavior is gated by capability flags and defaults, but policy edits immediately affect all connected clients for that environment.
Overview
Moves the inactivity auto-settle threshold from per-device client settings into server-owned
ServerSettings.threadSettlement, so web, desktop, and mobile classify threads the same way when connected to an environment.Web sidebar v2 and chat settled state now read
autoSettleAfterDaysfrom each thread’s environment server config (notsidebarAutoSettleAfterDays). Mobile thread list v2 passes a per-environment map intobuildThreadListV2Itemsinstead of a hard-coded three-day default. Settings → Beta updates the primary environment viaupdatePrimarySettingsand is disabled when the server lacksthreadSettlementPolicy.Contracts add
ThreadSettlementSettings, rename settle-day bounds to sharedTHREAD_AUTO_SETTLE_*constants, and keep the legacy client field for downgrade compatibility. The server advertisesthreadSettlementPolicy: trueand persists policy patches tosettings.json. Inactivity settlement remains a derived list view only—no newthread.settleautomation on the server.Reviewed by Cursor Bugbot for commit cb360a6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Move thread auto-settle policy from client settings to server-side environment config
threadSettlement.autoSettleAfterDaystoServerSettingsand athreadSettlementPolicycapability flag to environment descriptors, replacing the legacysidebarAutoSettleAfterDaysclient preference.threadSettlementPolicycapability.autoSettleAfterDaystonulldisables auto-settlement for that environment; missing entries fall back toDEFAULT_THREAD_AUTO_SETTLE_AFTER_DAYS(3 days).Macroscope summarized cb360a6.