Repository navigation
fix(sessions): isolate maintenance from channel plugin resolvers - #129490
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 2:58 PM ET / 18:58 UTC. ClawSweeper reviewWhat this changesReplaces plugin-aware thread detection during session maintenance with pure session-key suffix parsing and adds regression coverage for retention and SQLite writes. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open for maintainer review. The focused parser substitution removes plugin execution from the synchronous maintenance path, but the branch is behind main and its required-check rollup is red. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherSession-store maintenance classifies persisted conversation keys during SQLite updates. It feeds retention decisions that must not execute channel-plugin code, because a resolver exception can roll back an unrelated inbound turn. flowchart LR
A[Inbound channel turn] --> B[Session store update]
B --> C[Maintenance classification]
C --> D[Pure thread suffix parser]
D --> E[Retention decision]
E --> F[SQLite commit and reply]
G[Channel plugin resolver] -. must not run .-> C
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +126. Total +126 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase the net-neutral owner-boundary repair onto current main, preserve the transaction regression coverage, and merge only after exact-head checks pass. Do we have a high-confidence way to reproduce the issue? Yes—source establishes the failure path, and the added regression sets a throwing resolver while exercising unrelated SQLite session writes. Is this the best way to solve the issue? Yes—the maintenance owner only needs structural key classification; retaining plugin-aware parsing there would preserve the transaction-side exception path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1f812ac4faf1. LabelsLabel 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
HistoryReview history (1 earlier review cycle)
|
d76aff7 to
872d5c6
Compare
872d5c6 to
5d2cc61
Compare
|
Merged via squash.
|
What Problem This Solves
Fixes #121252.
A loaded channel plugin could execute its conversation resolver while synchronous session-store maintenance was classifying unrelated session keys. If that resolver threw, the SQLite write transaction rolled back and unrelated Telegram or Discord turns silently lost their replies.
Why This Change Was Made
The maintenance owner only needs structural thread-suffix detection. Replace its plugin-dispatching thread parser with the existing pure session-key suffix parser, removing all channel-plugin execution from synchronous maintenance while preserving primary sessions, synthetic entries, generic threads, Telegram topics, external group/channel conversations, archived rows, and pinned rows.
Production LOC: +2/-2 (net 0). Tests: +127/-1.
User Impact
A faulty or incompatible channel plugin can no longer abort unrelated inbound Telegram or Discord session writes. Their replies are delivered normally, and the faulty plugin's group session remains preserved by the existing retention policy.
Thanks @arividar for identifying the shared-maintenance failure mechanism.
Evidence
mainand pass with the repair.OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/config/sessions/store-maintenance-recent-preservation.test.ts src/config/sessions/store.pruning.test.ts src/config/sessions/session-accessor.conformance.test.ts src/channels/turn/run-channel-turn.finalize.test.ts: all 127 tests pass.env -u OPENCLAW_TESTBOX OPENCLAW_LOCAL_CHECK=1 node scripts/check-changed.mjs -- src/config/sessions/store-maintenance.ts src/config/sessions/store-maintenance-recent-preservation.test.ts src/config/sessions/session-accessor.conformance.test.ts: complete changed gate passes, including production/test typechecking, lint, formatting, dead-code checks, and database/schema guards.d76aff7bf695a22141bf8c075dd51f7f6495fb9d.