Skip to content

refactor(channels): adopt durable Nextcloud Talk and Nostr ingress - #110653

Merged
steipete merged 4 commits into
mainfrom
claude/ingress-nextcloud-nostr
Jul 18, 2026
Merged

steipete merged 4 commits into
mainfrom
claude/ingress-nextcloud-nostr

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #109657

What Problem This Solves

Nextcloud Talk webhooks and Nostr relay events could depend on process-local delivery and replay state, leaving accepted inbound messages vulnerable to restart gaps and incomplete terminal handling.

Why This Change Was Made

Adopts the core durable channel-ingress queue for both plugins. Claims remain owned through reply-lane terminal completion, append failures fail closed after bounded retries, terminal failures consume the retry budget before dead-letter, and restart recovery owns redelivery. Nostr cursor advancement is gated by relay EOSE and durable progress.

User Impact

Accepted Nextcloud Talk and Nostr inbound messages survive process restarts and are retried or dead-lettered through the shared durable-ingress contract instead of falling through volatile or dedupe-bypassing paths.

Evidence

  • pnpm test extensions/nextcloud-talk extensions/nostr src/channels/direct-dm.test.ts: 43 extension files / 361 tests and 2 focused core channel tests passed on the latest rebased head.
  • pnpm deadcode:unused-files and pnpm deadcode:exports: production, full-tree, and script scans passed with 0 entries.
  • Extension production/test type checks and extension oxlint passed on Testbox.
  • Branch-wide oxfmt --check passed for all 37 changed files; git diff --check origin/main...HEAD passed.
  • Testbox proof: https://github.com/openclaw/openclaw/actions/runs/29642178040
  • Mechanical gate fixes: split state/rate-limiter helpers, de-exported test-only helpers, corrected relay mock typing, and initialized durable ingress in the outbound Nostr test.
  • Live Nextcloud Talk and public Nostr relay credential proof was not available in this worktree; retain that as maintainer-round live proof.

@openclaw-barnacle openclaw-barnacle Bot added channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr size: XL maintainer Maintainer-authored PR labels Jul 18, 2026
@steipete steipete self-assigned this Jul 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 7:27 AM ET / 11:27 UTC.

Summary
The branch replaces Nextcloud Talk and Nostr process-local ingress/replay handling with durable channel-ingress queues, lifecycle completion wiring, and state migration paths.

PR surface: Source +888, Tests +869. Total +1757 across 39 files.

Reproducibility: yes. source-level behavior is identifiable: the PR targets the gap between accepting an inbound event and durable terminal completion across a restart. A high-confidence live reproduction was not supplied for either actual transport.

Review metrics: 1 noteworthy metric.

  • Durable ingress scope: 2 channel adapters and 2 replay-state migration paths. Both inbound transports move from channel-specific replay handling to durable queue ownership, so fresh and upgrade behavior must be reviewed separately.

Stored data model
Persistent data-model change detected: migration/backfill/repair: extensions/nextcloud-talk/src/doctor.test.ts, migration/backfill/repair: extensions/nextcloud-talk/src/doctor.ts, migration/backfill/repair: extensions/nextcloud-talk/src/webhook-spool.ts, migration/backfill/repair: extensions/nostr/src/nostr-relay-subscription.test.ts, serialized state: extensions/nextcloud-talk/src/webhook-spool-state.ts, serialized state: extensions/nextcloud-talk/src/webhook-spool.test.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted live durable-admission plus restart/recovery evidence for a Nextcloud Talk webhook.
  • [P1] Add redacted live relay/EOSE/restart evidence for Nostr.
  • Complete maintainer review of state migration and terminal lifecycle behavior.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR supplies focused tests, Testbox/CI references, and static checks, but its body explicitly says live Nextcloud Talk and public Nostr relay restart/recovery proof was unavailable; add redacted live output or recordings before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Merging changes the accepted-message durability and retry/dead-letter behavior for Nextcloud Talk and Nostr; a missed lifecycle or cursor edge case could duplicate, delay, or lose inbound messages after restart.
  • [P1] The patch migrates retired replay state into durable queue tombstones, so maintainers need upgrade-path review in addition to fresh-install behavior.
  • [P1] The submitted evidence is test and CI oriented; the PR body confirms that live restart/recovery behavior against a Nextcloud Talk instance and a public Nostr relay has not been demonstrated.

Maintainer options:

  1. Add channel-level live recovery proof (recommended)
    Before merge, demonstrate durable-before-ack and restart redelivery/terminal completion for each transport with redacted live evidence.
  2. Accept tested-only transport coverage
    Maintainers may accept the remaining live-proof gap if they explicitly own the risk that real webhook and relay behavior differs from the mocked paths.
  3. Split the transports
    Pause one transport if its live environment or migration behavior cannot be reviewed with the same confidence as the other.

Next step before merge

  • [P1] Protected maintainer review and missing live transport proof require human validation rather than an automated repair lane.

Maintainer decision needed

  • Question: Should this protected delivery refactor merge after maintainer validation of the two channel-specific upgrade and live recovery paths, or should the durable migrations be narrowed until that proof is available?
  • Rationale: The PR deliberately changes persistent ingress ownership and retry semantics for externally delivered messages; correctness depends on channel-specific runtime behavior that tests and static CI cannot fully establish.
  • Likely owner: steipete — The current PR author is also assigned and authored the durable-ingress implementation; independent area ownership history could not be verified.
  • Options:
    • Validate and merge with live proof (recommended): Review the migration and lifecycle semantics, then require redacted live durable-admission and restart-recovery evidence for Nextcloud Talk and Nostr before landing.
    • Split channel migrations: Land only the channel whose live and upgrade behavior can be demonstrated, keeping the other transport in a narrower follow-up.
    • Pause for contract changes: Pause the PR if maintainers want different queue ownership, failure, or cursor-progress semantics than the shared ingress contract provides.

Security
Cleared: No concrete new dependency, secret, permission, or supply-chain concern is evident from the supplied PR surface; the primary risk is message-delivery correctness rather than a demonstrated security regression.

Review details

Best possible solution:

Retain the shared durable-ingress design, complete owner review of each channel’s admission, terminal-completion, migration, and shutdown paths, then add redacted live restart/recovery proof for both transports before merging.

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

Yes, source-level behavior is identifiable: the PR targets the gap between accepting an inbound event and durable terminal completion across a restart. A high-confidence live reproduction was not supplied for either actual transport.

Is this the best way to solve the issue?

Unclear. Reusing the shared durable-ingress contract is the right architectural direction, but the channel-specific migration and live recovery behavior still need owner validation before it can be called the best complete fix.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against efa7e1a85ad7.

Label changes

Label changes:

  • add P1: The PR addresses crash-window message durability for two inbound channels, where an error could affect real message delivery.
  • add merge-risk: 🚨 compatibility: The patch retires existing replay state and introduces doctor/queue migration behavior that existing channel installations must survive.
  • add merge-risk: 🚨 message-delivery: Admission, retry, dead-letter, and terminal lifecycle behavior directly determine whether accepted inbound messages are redelivered, duplicated, or dropped.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR supplies focused tests, Testbox/CI references, and static checks, but its body explicitly says live Nextcloud Talk and public Nostr relay restart/recovery proof was unavailable; add redacted live output or recordings before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: The PR addresses crash-window message durability for two inbound channels, where an error could affect real message delivery.
  • merge-risk: 🚨 message-delivery: Admission, retry, dead-letter, and terminal lifecycle behavior directly determine whether accepted inbound messages are redelivered, duplicated, or dropped.
  • merge-risk: 🚨 compatibility: The patch retires existing replay state and introduces doctor/queue migration behavior that existing channel installations must survive.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR supplies focused tests, Testbox/CI references, and static checks, but its body explicitly says live Nextcloud Talk and public Nostr relay restart/recovery proof was unavailable; add redacted live output or recordings before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +888, Tests +869. Total +1757 across 39 files.

View PR surface stats
Area Files Added Removed Net
Source 21 1782 894 +888
Tests 18 1474 605 +869
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 39 3256 1499 +1757

What I checked:

  • Protected maintainer review: The PR has the maintainer label and is self-assigned, so the cleanup workflow must not close it automatically; its delivery and upgrade semantics need an explicit human review. (53db423486b4)
  • Durable delivery surface: The patch adds durable admission and drain implementations for both channels, including retry/dead-letter ownership and lifecycle binding into reply dispatch. (extensions/nextcloud-talk/src/webhook-spool.ts:1, 53db423486b4)
  • Nostr durable state and cursor path: The patch adds Nostr ingress persistence and an EOSE-gated cursor implementation, making relay restart and replay behavior part of the merge surface. (extensions/nostr/src/nostr-ingress.ts:1, 53db423486b4)
  • Related durable-ingress initiative: The linked open issue tracks adoption of the same shared ingress drain for other channels, but it explicitly names different remaining transports; it is related architecture work rather than a replacement for this PR.
  • Real behavior proof gap: The PR body reports focused tests and Testbox checks but explicitly says live Nextcloud Talk and public Nostr relay credential proof was unavailable. (53db423486b4)

Likely related people:

  • steipete: Authored all four commits in this PR and is assigned to it; no independent current-main ownership history could be completed in the read-only execution environment. (role: current implementation author and assigned reviewer; confidence: low; commits: 4c931dd3fc4a, 5e4aa55334ee, 7a0f9b8e6da7; files: extensions/nextcloud-talk/src/webhook-spool.ts, extensions/nostr/src/nostr-ingress.ts, extensions/nostr/src/nostr-bus.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53db423486

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

receivedAt: prepared.receivedAt,
laneKey: prepared.facts.laneKey,
});
options.afterDurableAppend(prepared.event);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Advance the cursor only for the admitted row

When a relay sends an event ID that is already in the ingress queue, enqueue returns a duplicate and the current relay payload was not durably admitted, but this still records prepared.event.created_at as durable progress. Because signature/hash validation only happens later during drain dispatch, a malformed duplicate ID with a newer timestamp can advance the EOSE-gated cursor and make the next subscription skip valid DMs in that time range. Gate the cursor hook on a newly accepted row, or record progress from the already-persisted row rather than the unverified duplicate payload.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 7a35e24 into main Jul 18, 2026
181 of 192 checks passed
@steipete
steipete deleted the claude/ingress-nextcloud-nostr branch July 18, 2026 16:30
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 19, 2026
…penclaw#110653)

Accepted Nextcloud Talk webhook and Nostr relay messages now use the shared durable channel-ingress queue. Claims stay owned until reply-lane terminal completion; bounded append and delivery retries fail closed into dead-letter handling; restart recovery owns redelivery; and Nostr cursors advance only after relay EOSE and durable progress.

Related: openclaw#109657
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…penclaw#110653)

Accepted Nextcloud Talk webhook and Nostr relay messages now use the shared durable channel-ingress queue. Claims stay owned until reply-lane terminal completion; bounded append and delivery retries fail closed into dead-letter handling; restart recovery owns redelivery; and Nostr cursors advance only after relay EOSE and durable progress.

Related: openclaw#109657
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant