Repository navigation
fix(slack,mattermost): preserve thread participation expiry across restarts - #118630
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 7:03 AM ET / 11:03 UTC. ClawSweeper reviewWhat this changesThe PR makes Slack and Mattermost restore thread-participation cache entries with their persisted reply timestamp so a gateway restart cannot extend implicit thread-reply eligibility. Merge readinessKeep this PR open for maintainer landing: current main still re-primes the memory cache at restart time, while the branch restores the persisted reply time and thereby preserves the documented expiry boundary. The patch is narrow, matches the existing shared-cache contract, has focused regression coverage and credible real-owner proof; the protected Priority: P1 Review scores
Verification
How this fits togetherSlack and Mattermost record that the bot visibly replied in a thread, then use that participation record to allow later thread follow-ups without a new mention. The record is kept both in process memory and in plugin SQLite state; on a restart, the persistent lookup re-primes the in-memory fast path that decides whether inbound messages activate the bot. flowchart LR
A[Bot sends visible thread reply] --> B[Plugin records reply timestamp]
B --> C[Memory participation cache]
B --> D[Plugin SQLite keyed state]
E[Gateway restart] --> F[Persistent participation lookup]
D --> F
F --> C
C --> G[Implicit thread-reply gate]
G --> H[Reply allowed or mention required]
Decision needed
Why: The branch is a focused bug repair with strong evidence, but the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +28. Total +32 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the two owner-local timestamp restorations after exact merge-ref checks are green, preserving one shared persistent-cache implementation and the established reply-time expiry invariant. Do we have a high-confidence way to reproduce the issue? Yes. Current main lacks both owner timestamps, the shared cache defaults a persistent hit to the current time, and the PR provides exact-parent RED versus candidate GREEN restart proofs for both actual channel owners. Is this the best way to solve the issue? Yes. Supplying the already-persisted authoritative AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fe6fa891ea4e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…penclaw#118630) Co-authored-by: Peter Steinberger <[email protected]>
What problem this solves
After a gateway restart, Mattermost and Slack restored a persisted thread-participation record using the restart time instead of the time when the bot actually last replied. A restart immediately before expiry therefore silently granted almost another seven days of Mattermost mention/onchar bypass or another 24 hours of Slack mention bypass.
Both defects are present in stable
v2026.7.1andv2026.7.2-beta.7. Mattermost explicitly documents that participation lasts seven days after the bot last replied and survives gateway restarts.Why this change was made
Each plugin's participation owner now supplies its already-persisted
repliedAttimestamp to the existing shared persistent-dedupereadTimestampcontract. This is the same contract already used by the Microsoft Teams sent-message owner; no shared SDK, storage schema, account policy, configuration, compatibility fallback, or dependency changes are needed.SQLite already expires the durable row at the original deadline. Restoring process memory with the same original timestamp ensures its memory-first fast path cannot continue accepting an expired participation record after SQLite would reject it.
User impact
Evidence
85f74ae2ff237f268dd46cbed5fdf32012b8b7de; sole parentc53e594aae79690d7bc809157c904a5ecd745190; complete approved four-file binary diff SHA-256622ca7b45cadc8cb05c04e9734a4d90432a2476d0bae30101359f0e0494d035c.git diff --checkpassed on the immutable candidate.gpt-5.6-sol/ high / P3 review reported zero findings and 0.96 confidence; checksum-authenticated native TruffleHog 3.96.0 passed.mainandorigin/mainfe6fa891ea4ef3bb152d02df944a8def6518fdd1leave all four changed files, all relevant scoped policies, all 31 authenticated owner/SDK/SQLite/docs/CI siblings, the frozen lockfile, and the Microsoft Teams sibling unchanged.Real behavior proof
Root-owned Blacksmith lease
tbx_01kz3knq0ywxgdtje656h3mhz8executed the hash-authenticated original-parent and immutable-candidate proofs against the actual production Slack and Mattermost plugin owners, canonical persistent-dedupe SDK, real plugin runtime, and real Kysely-backed sharedstate/openclaw.sqliteplugin-state database:repliedAt; a real Kysely query authenticated the exact plugin/account/thread key and original SQLite expiry.{"proof":"thread-participation-real-owner-sqlite-and-full-gate","candidate":"85f74ae2ff237f268dd46cbed5fdf32012b8b7de","parent":"c53e594aae79690d7bc809157c904a5ecd745190","changedPaths":4,"parentPhysicalRed":2,"parentCommittedRegressionsRed":2,"candidatePhysicalGreen":2,"focusedTests":16,"completeChangedGate":"PASS","externalNetworkAttempts":0}Complete authenticated gate:
Maintainer merge-risk decision
Maintainer decision: accept the documented seven-day Mattermost and 24-hour Slack expiry correction; exact head 85f74ae passed both channel-contract shards, all six changed-node shards, channel-runtime-boundary analysis, build artifacts, the complete exact-four changed gate, 16 owner tests, and real parent-RED/candidate-GREEN SQLite restart proofs.
Expired participation must not silently activate a thread after its documented deadline. This changes only activation after genuinely expired participation; account authorization, channel boundaries, the existing durable storage format, schema, and SDK remain unchanged. No database migration or schema-version change is involved.