Skip to content

fix(clickclack): await durable discussion identity - #149574

Merged
steipete merged 2 commits into
mainfrom
codex/clickclack-discussions-async-storage
Sep 16, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/clickclack-discussions-async-storage

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

ClickClack discussion registration currently initializes its durable installation identity with synchronous SQLite calls on the host thread.

User Impact

Discussion ownership references retain the same installation identity. If the persisted identity disappears during initialization, opening fails with retry guidance before any channel is created. Existing data needs no migration or operator action.

Why This Change Was Made

Initialize the identity when a discussion is opened, using the existing worker-backed keyed store. Atomic insert-if-absent and a read of the stored winner preserve a single identity across concurrent initializers. Return only that persisted winner; a generated candidate cannot substitute for a missing row. Keep the namespace, key, capacity, and overflow policy unchanged.

Evidence

  • 41 focused service and persistence tests passed, including concurrent initialization against the production SQLite store and refusal to create a channel when persistence fails or the final installation row is absent.
  • Both missing-row cases reproduced the defect before the correction: opening incorrectly succeeded after either accepted or declined registration. Both now reject without creating a channel.
  • The real SQLite persistence test runs in the existing forked database-worker lane, where the host broker is available.
  • Full changed checks passed, including production and test typechecks, lint, dependency and storage guards, and import-cycle checks.
  • Independent review found no actionable P0–P2 issues.

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 16, 2026 01:41
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 15, 2026, 9:47 PM ET / September 16, 2026, 01:47 UTC.

ClawSweeper review

What this changes

ClickClack discussion opening now awaits its durable installation identity through the existing asynchronous store and rejects missing persistence before creating a channel.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful, focused fix: pinned main and the latest release retain the synchronous initializer and generated-ID fallback. No actionable introduced defect was found.

Priority: P2
Reviewed head: 362a5c489afa77ac25e6a4079e661821c79b6169

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair using an existing storage owner, with relevant regression coverage and no blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from ordinary contributor proof; supplied evidence covers production SQLite with mocked channel I/O, not a live ClickClack run, and no material authority change activates additional proof requirements.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from ordinary contributor proof; supplied evidence covers production SQLite with mocked channel I/O, not a live ClickClack run, and no material authority change activates additional proof requirements.
Evidence reviewed 7 items Reviewed introduction boundary: The host verified the complete merge-base-to-head patch and a test merge containing exactly the pinned base followed by the original head. The introduced change is confined to identity initialization, its service caller, persistence tests, and database-worker test routing.
Durable winner required before remote creation: The initializer awaits lookup and atomic registration, returns the stored winner, and rejects an absent final row. Service opening awaits this before resolving accounts or entering channel creation; other installation-ID consumers were checked.
Existing storage contract reused: Both store factories use the same plugin ID, namespace, options, and SQLite storage contract. The asynchronous lookup and insert-if-absent operations dispatch through the existing worker owner. The PR preserves the namespace, current key, JSON value, capacity, and overflow policy; it adds no SDK API or stored-data model.
Findings None None.
Security None None.

How this fits together

The ClickClack plugin connects OpenClaw sessions to managed discussion channels. Its persisted installation identity contributes to remote ownership references used to create or recover the correct channel.

flowchart TD
  A[Open discussion request] --> B[Read persisted installation identity]
  B --> C{Identity exists?}
  C -->|Yes| E[Resolve session and account]
  C -->|No| D[Insert candidate and read stored winner]
  D -->|Persisted| E
  D -->|Unavailable| F[Return retry error]
  E --> G[Create or recover discussion channel]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +9, Tests +63. Total +72 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 16 7 +9
Tests 2 64 1 +63
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 80 8 +72

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/clickclack/src/discussions/installation.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one durable installation identity through the existing worker-backed store, preserving stored ownership references and refusing remote creation without a persisted identity.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: the current initializer performs synchronous storage operations and returns an unpersisted candidate when its final lookup is empty. Runtime reproduction was not executed in this read-only review.

Is this the best way to solve the issue?

Yes. The patch uses the existing asynchronous store and preserves the persisted contract, with focused failure and concurrency coverage at the discussion service boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fc1cadae3286.

Labels

Label changes:

  • add P2: This is a bounded discussion-initialization reliability and host-thread improvement.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from ordinary contributor proof; supplied evidence covers production SQLite with mocked channel I/O, not a live ClickClack run, and no material authority change activates additional proof requirements.

Label justifications:

  • P2: This is a bounded discussion-initialization reliability and host-thread improvement.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from ordinary contributor proof; supplied evidence covers production SQLite with mocked channel I/O, not a live ClickClack run, and no material authority change activates additional proof requirements.

Evidence

What I checked:

  • Reviewed introduction boundary: The host verified the complete merge-base-to-head patch and a test merge containing exactly the pinned base followed by the original head. The introduced change is confined to identity initialization, its service caller, persistence tests, and database-worker test routing. (362a5c489afa)
  • Durable winner required before remote creation: The initializer awaits lookup and atomic registration, returns the stored winner, and rejects an absent final row. Service opening awaits this before resolving accounts or entering channel creation; other installation-ID consumers were checked. (extensions/clickclack/src/discussions/installation.ts:8, 362a5c489afa)
  • Existing storage contract reused: Both store factories use the same plugin ID, namespace, options, and SQLite storage contract. The asynchronous lookup and insert-if-absent operations dispatch through the existing worker owner. The PR preserves the namespace, current key, JSON value, capacity, and overflow policy; it adds no SDK API or stored-data model. (src/plugin-state/plugin-state-store.ts:202, 362a5c489afa)
  • Established ownership-reference contract: Documentation defines a durable installation namespace within the remote reference and identifies host grants and tool-policy hooks as the authorization boundary. The patch preserves these identities and boundaries rather than introducing a new grant or principal. Public docs: docs/channels/clickclack.md. (docs/channels/clickclack.md:284, 362a5c489afa)
  • Focused regression coverage: The complete test file covers concurrent initialization against production SQLite, persistence failure before channel creation, and missing final rows after either registration result. The existing forked database-worker lane supplies the broker. The captured PR body reports 41 passing focused tests and before-fix failures; these claims were not independently executed during this read-only review. (extensions/clickclack/src/discussions/service-state-persistence.test.ts:37, 362a5c489afa)
  • Still necessary on pinned main and latest release: Both pinned main and v2026.9.4 retain openSyncKeyedStore and the generated candidate fallback. No supplied merged fixing PR establishes supersession. The attempted related-PR search was denied by the read proxy, so no broader canonical-search result is claimed. (extensions/clickclack/src/discussions/installation.ts:8, fc1cadae3286)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • ragesaq: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 63a3009 into main Sep 16, 2026
216 checks passed
@steipete
steipete deleted the codex/clickclack-discussions-async-storage branch September 16, 2026 02:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
* perf(clickclack): initialize discussion identity asynchronously

* fix(clickclack): require persisted discussion installation identity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: clickclack maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant