Repository navigation
fix(clickclack): drain discussion opens before shutdown - #151978
Conversation
Move pending discussion generation reads and mutations to the shared SQLite worker, preserving FIFO and conditional replacement checks. Recheck live creation authority after persistence waits and join accepted operations through recovery and timer reassessment before service retirement. Retain the declared 2026.9.4 host compatibility path only when comparison capabilities are absent. Stored formats, limits, retention, bindings, revocations, and synchronous visibility remain unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 1:17 PM ET / 17:17 UTC. ClawSweeper reviewWhat this changesMoves ClickClack discussion recovery state to asynchronous storage and makes shutdown and restart wait for accepted discussion operations. Merge readiness✅ Ready for maintainer review The shutdown fix remains necessary on current main. No blocking introduced defect was found; this maintainer-authored PR should proceed through normal merge gates. Priority: P2 Review scores
Verification
How this fits togetherClickClack discussions connect OpenClaw sessions to durable chat rooms. The plugin coordinates room creation, persisted ownership, inbound routing, and recovery during service shutdown or restart. flowchart TD
A[Discussion requests and session events] --> B[Service admission]
B --> C[Pending recovery storage]
C --> D[Check current account and session]
D --> E[Create or recover ClickClack room]
E --> F[Persist binding and enable routing]
G[Stop or restart] --> B
B --> H[Wait for accepted operations]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +203, Tests +318, Docs +13. Total +534 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one discussion-service lifecycle owner that drains accepted work while preserving durable room identity, quarantine ordering, and released-host compatibility. Do we have a high-confidence way to reproduce the issue? Yes, from source: hold an accepted discussion open before channel creation and call cleanup; current main returns without waiting for that operation. This review did not execute the scenario. Is this the best way to solve the issue? Yes. The patch extends the existing service and storage owners, preserves stored formats, and selects older-host compatibility before execution rather than replaying failed mutations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 31044b634cdd. 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.
|
* origin/main: test(gateway): isolate session resolution channel fixtures (#151945) fix(clickclack): drain discussion opens before shutdown (#151978) fix(test): restore trusted packaging harness startup (#151967) improve(codex): batch session adoption binding reads (#151979) improve(cron): reduce allocations for busy stream sources (#151956) fix(file-transfer): avoid repeated directory record encoding (#151987) fix: avoid session-list rebuilds when authentication availability changes (#151920) fix(updates): explain externally managed update refusals (#151942) improve(heartbeat): avoid unused config work in membership checks (#151867) fix(android): keep status text readable and label accessibility actions (#151342) improve(ui): show OS and size in the environment selector (#151947) fix(android): keep tool errors visible in collapsed chat activity (#151332)
) Move pending discussion generation reads and mutations to the shared SQLite worker, preserving FIFO and conditional replacement checks. Recheck live creation authority after persistence waits and join accepted operations through recovery and timer reassessment before service retirement. Retain the declared 2026.9.4 host compatibility path only when comparison capabilities are absent. Stored formats, limits, retention, bindings, revocations, and synchronous visibility remain unchanged.
What Problem This Solves
ClickClack discussion recovery can block the Gateway thread, and stopping the service can return while accepted opens still create channels and persist state.
User Impact
Current hosts process pending discussion state off the Gateway thread. Stop and restart now wait for accepted discussion operations to finish. Existing room identity, recovery, idle polling, stored data, and configuration remain compatible; no migration is required.
Why This Change Was Made
Move the existing generation and pending-open namespace to worker-backed keyed operations. FIFO settlement and observed-row comparisons preserve replacement generations, while channel creation awaits durable quarantine and rechecks the current account, API endpoint, and active session. The existing binding → tombstone clear → matching generation clear recovery order remains intact.
The service closes admission and joins whole operations, including work that can enqueue channel mutations later and the final polling reassessment. Both registered cleanup paths return that completion. The declared OpenClaw 2026.9.4 host floor retains uninterrupted native mutations only when comparison capabilities are absent; available worker failures never fall back. Bindings, revocations, synchronous visibility, schemas, limits, and retention keep their existing owners and contracts.
Evidence