Skip to content

refactor(plugins): simplify private notification ownership - #177398

Merged
steipete merged 1 commit into
mainfrom
deslop/z36-2-extensions-20261015
Oct 19, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z36-2-extensions-20261015

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Maintainer-requested cleanup: several private plugin owners maintain listener registries for one production consumer, or expose an unused raw callback.

User Impact

No intended user-visible change, migration, or public Plugin SDK change. Recording, ingress delivery, pairing notifications, standing intents and Workboard events retain their existing behavior.

Why This Change Was Made

Use one callback at each private producer/consumer boundary instead of subscriber containers and unsubscribe handles. Remove IRC's unused raw-line hook; keep parsed messages and transport liveness. Producer and consumer changes land together. This does not remove the reliability behavior introduced by #139658, #81746 or #122146.

Net production LOC: 37 removed (+48/-85 across 10 production files; 19 changed files total). Tests and fixtures excluded.

Best-effort tradeoffs accepted

  • Discord inputs have one recording owner; unsupported independent recorders no longer each subscribe to the same private input.
  • Telegram has one polling-session consumer per ingress worker; competing private consumers replace one another. Spool ACK, replay, worker recovery and shutdown settlement remain.
  • Workboard allocates a fresh store with one change-event service per registration. Independent services sharing that private store are unsupported; ordinary repeated start/stop and the Gateway event contract remain.
  • Pairing has one notifier, and standing-intent maintenance has one service covering its agents. Bypassing normal stop-before-restart with overlapping independent owners is best effort; a restart repairs such unsupported ownership. No human incident requires the removed subscriber multiplicity.
  • Feishu has one message-handler abandonment callback. IRC's raw-line callback had no production caller. No external hook contract is removed.

Evidence

  • Fresh-main focused proof, isolated state, nice -n 10, one worker: 15 files / 280 cases passed across Discord, IRC, database-worker, Telegram and miscellaneous plugin configurations. Includes accepted-write settlement, rollback, service recreation, interrupted delivery, standing-intent scheduling and Workboard authority/epoch events.
  • Targeted extension types, focused lint/format and line-cap non-growth passed. Runtime value cycles: 0; Madge cycles: 0.
  • Isolated review completed. Two speculative overlapping-owner recommendations were declined against the actual registration/lifecycle owners described above; no accepted actionable finding remains.
  • The local suppression gate passed 13/14 cases; its sole failure is the unchanged src/gateway/session-row-scope.ts unicorn/no-new-array allowlist entry, matching scheduled main run 39261680942. No suppression was added here.
  • Exact-head PR CI supplies broad proof. No live channel or deployment claim.

Replace single-consumer listener registries with callbacks across recording, ingress, Workboard and maintenance. Keep public contracts, authorization, durable delivery, accepted-write settlement and ordinary reload behavior.

Best effort: unsupported overlapping independent owners of private callback slots may replace one another; service-owned stop-before-restart remains the supported lifecycle. Remove the unused IRC raw-line hook with its test-only consumer.
@clawsweeper

clawsweeper Bot commented Oct 19, 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 October 19, 2026 14:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T14:40:28.220419Z 32cf903 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: telegram Channel integration: telegram extensions: memory-core Extension: memory-core channel: feishu Channel integration: feishu extensions: device-pair channel: irc plugin: workboard size: M labels Oct 19, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces private listener registries with single callbacks across plugins and removes IRC’s unused raw-line callback.

Example: Telegram’s ingress worker receives update_id 42.

  • Before: The worker notifies its listener registry, whose production consumer is the polling session.
  • After: The worker invokes the polling session’s callback directly; durable admission still precedes acknowledgment.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, coherent simplification with no concrete defect found; validation is harness-based, and one added mock-forwarding assertion block has little independent value.
Proof confidence 🦐 gold shrimp (3/6) Maintainer-authored refactor outside the ordinary proof gate; supplied validation is focused tests and CI, with no live-channel claim and no material authority-boundary change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No direct user-visible defect is claimed; unnecessary private subscription machinery increases maintenance work.
Reason: The maintainer-authored direction removes machinery, migrates consumers together, and explicitly accepts the narrow unsupported ownership tradeoffs.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: the simplification preserves supported ownership and delivery paths, with no actionable correctness or security finding.

Priority: P3
Reviewed head: 32cf90375d0a26cc906204d3b88ac8f61ade953b

Before merge

None.

Findings

None.

Tests

  • Low-value test extensions/telegram/src/telegram-ingress-worker.test.ts: Remove the added callback call-count block: it mirrors the forwarding implementation using a fake Worker, while polling-session tests already exercise delivery through real worker cases.
  • Missing end-to-end proof: No shipped-entry-point demonstration of the refactored paths is supplied; the maintainer-authored PR is outside the ordinary contributor proof gate.
Agent review details

How this fits together

Private plugin producers report recording progress, ingress events, committed changes, and maintenance deadlines to their existing lifecycle owners, which retain responsibility for delivery, persistence, and cleanup.

flowchart TD
  A[Plugin producer] --> B[Private callback]
  B --> C[Existing lifecycle owner]
  C --> D[Durable store or transport]
  C --> E[Gateway event or maintenance job]
  F[Service retirement] --> C
Loading

Technical review

Best possible solution:

Retain the direct private callbacks and existing lifecycle owners, without restoring unsupported subscriber multiplicity.

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

This is a behavior-preserving refactor rather than a reported bug; source and caller inspection establish the private ownership boundaries.

Is this the best way to solve the issue?

The change is a small, complete cutover using existing producers and consumers, and the explicitly accepted overlapping-owner cases do not justify additional machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Discord realtime recording keeps the original intent (c6ef1f2: Keep recording independent of conversation failures while retaining packet-time capture authority and safely bounded realtime fallback.)
  • Telegram worker notifications keeps the original intent (fd244fd: Isolate polling from main-thread stalls and durably admit updates before advancing the transport offset.)
  • Workboard change notifications and lifetime keeps the original intent (7baae61: Unify store lifetime, admitted-operation drainage, mutation ordering, and change tracking to prevent reload descriptor leaks.)
  • Feishu abandonment callback keeps the original intent (736dddb: Preserve durable ingress and release logical replay claims when transport work is abandoned before adoption.)
  • Device-pair notifier wakeups keeps the original intent (5f130b5: Park empty notification maintenance while waking reconciliation after owned writes, including failed replies after commits.)
  • Standing-intent maintenance keeps the original intent (ed32471: Schedule maintenance from worker-owned deadlines and recover overdue work at service startup.)
  • IRC raw-line hook changes intended behavior with a stated reason (fa906b2: The initial IRC client exposed a raw-line observer; current production callers use parsed events and transport callbacks, and the PR explains removal of the unused private hook.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ed32471 adds extensions/memory-core/src/standing-intents.ts:125 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ed324718a3f1; files: extensions/memory-core/src/standing-intents.ts)
  • Josh Avant: Raw commit fd244fd adds extensions/telegram/src/telegram-ingress-worker.ts:63 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fd244fd76de3; files: extensions/telegram/src/telegram-ingress-worker.ts)

PR surface

Source -37, Tests -32. Total -69 across 19 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 10 48 85 -37
Tests 9 66 98 -32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 114 183 -69

Review metrics

Metric Value Why it matters
Production versus test LOC Production +48/-85; tests +66/-98 The net reduction removes listener containers and unsubscribe bookkeeping while adapting existing consumer fixtures.

Labels

Label changes:

  • add P3: Maintainer-approved internal simplification with no intended user-visible behavior change or demonstrated urgent defect.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: Maintainer-approved internal simplification with no intended user-visible behavior change or demonstrated urgent defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Remove the redundant Telegram mock-forwarding assertion block.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 10:53 AM ET / 14:53 UTC.

@steipete
steipete merged commit c5c5ee7 into main Oct 19, 2026
191 of 197 checks passed
@steipete
steipete deleted the deslop/z36-2-extensions-20261015 branch October 19, 2026 14:57
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…177398)

Replace single-consumer listener registries with callbacks across recording, ingress, Workboard and maintenance. Keep public contracts, authorization, durable delivery, accepted-write settlement and ordinary reload behavior.

Best effort: unsupported overlapping independent owners of private callback slots may replace one another; service-owned stop-before-restart remains the supported lifecycle. Remove the unused IRC raw-line hook with its test-only consumer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: irc channel: telegram Channel integration: telegram extensions: device-pair extensions: memory-core Extension: memory-core P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: workboard rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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