Repository navigation
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a startup migration that uses non-trivial burst heuristics to rewrite settled timestamps across both V1 and V2 projections. Although the scope is targeted and well tested, the complexity and persisted-data impact warrant human review. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughMigration 60 repairs qualifying client-attributed settlement timestamps in the V1 and V2 thread projections. It is registered in the migration runner, and migration tests cover repair criteria, unchanged cases, and upgrade ordering. ChangesSettlement timestamp repair
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change repairs historical settlement timestamps in both thread projections and leaves event history untouched. Tests cover the selection criteria and rerun safety, and no concrete merge-blocking risk was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The repair narrowly targets historical settlement timestamps and preserves recorded events. No new public access path was identified, but interruption and concurrent-retry behavior for the two-step repair was not fully established. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Desktop 0.0.35 to 0.0.38 settled idle threads from the client in one burst and stamped each with the sweep time. Migration 046 skips client-attributed events, so these were never repaired, and the V1 to V2 import copied them. Migration 060 finds those sweeps and restores each thread's last activity time in both the V1 and V2 projections. Closes #10937 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
5fe5cf4 to
3413260
Compare
Problem
Desktop builds 0.0.35 to 0.0.38 settled idle threads from the client in one burst and stamped each thread's settled time with the sweep time instead of its last activity. Those threads still sit in the sidebar's Settled section with the wrong age, bunched together as if they were all closed at the same moment. Migration 046 repaired the server-attributed version of this, but it skips client-attributed events on purpose, so these were never fixed. The V1 to V2 import then copied the bad values into V2 (#10937).
Change
New migration 060 finds the client-attributed sweeps and puts the real last-activity time back:
thread.settledV1 events withactor_kind = 'client', an app version from 0.0.35 to 0.0.38, before 2026-09-05, where the event'ssettledAtequals itsoccurred_at(the sweep's stamp).projection_threads.settled_atfor threads not imported yet, andsettledAtinsideorchestration_v2_projection_threads.payload_jsonfor threads already imported into V2.This rebuilds #10975 by @Gigioxx on current main, which has one migration chain for V1 and V2. 059 is the last migration on main.
Scope and approval
Closes #10937. The issue is triaged and accepted. Julius's triage confirmed the gap in 046 and the discriminators used here: client actor, the affected app versions, the cutoff date, and a dense burst.
Verification
There's no new UI. The bug is old data in existing databases, so the evidence is the migration test run against both branches. The test seeds a 12-thread client sweep plus the cases that must not change, then runs every migration.
Before (main 1e2ecbd, with the new test file copied in): the swept thread keeps the sweep time.
expected '2026-09-04T13:33:00.000Z' to equal '2026-04-01T00:00:00.000Z'.10975-before.mp4
After (this PR): passes.
10975-after.mp4
vp test run apps/server/src/persistence/Migrations/060_RepairClientSettlementTimestamps.test.tscovers:The neighboring migration tests (046, 054, 055, 056, 057) and the V2 preview upgrade test pass.
055_OrchestrationV2.test.tschanges only because it lists the migrations by count. Scopedtscand lint are clean.Not checked: a real database from an affected 0.0.35 to 0.0.38 install. An independent review also replayed the original audit fixture through this migration (57 before the renumber) and saw every swept thread repaired.
Made with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code