Skip to content

refactor(cron): hold message authority from the Gateway owner for core transports (cron 2a/3) - #164906

Merged
steipete merged 15 commits into
mainfrom
dbasync/cron2
Oct 4, 2026
Merged

steipete merged 15 commits into
mainfrom
dbasync/cron2

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Scheduled message authority was checked before asynchronous transport preparation. Core message handoffs need to retain current authority until the provider call or database commit actually begins.

Solution

Build on the merged #164805 receipt-authority owner with exact, one-shot held uses. Shared HTTP, Discord, Slack and Telegram carry the originating preparation through queues and reacquire for each request/retry. Read acceptance reacquires authority. Internal-source replies prepare media before taking the persistence interval and explicitly carry the live assertion into the worker transaction and commit.

The foundation is merged, and this PR targets main; validation is pinned to main commit 0068b18116bfefed780b1eef840733284944685e. All 35 lane code/test files are byte-identical across that main merge.

The typed refusal now lives in a dependency-free error leaf; the sibling cron 3/3 consumer must import it from src/cron/store/receipt-authority-error.ts. Its methods, reasons and behavior are unchanged.

The shared held-use contract was pushed first in 2a4d54f9159f5ceb2ef6498bbd3adbe992607c2c for the sibling cron 3/3 lane. Scoped Slack clients stay out of reusable caches while preserving listener workspace identity.

Impact

This is the approved additive 2a stage. The existing synchronous current-job checker remains active. Remaining transport-specific adapters are unchanged; their migration and final native-checker deletion are preserved for 2b. Consumers of shared guarded HTTP also inherit its held handoff. This PR does not claim complete all-transport activation or elimination of legacy caller-thread SQL.

Receipt semantics, force-disabled eligibility, grant eligibility, schemas, versions, retention and existing synchronous SDK signatures remain unchanged. The SDK capture API is additive. No dependency patch or new OPENCLAW_* name is introduced. Cron writes retain the single serving Gateway authority model; direct concurrent SQLite writers are unsupported.

Related overlap: #162433 and #135889; integrated the landed cleanup #164810 without reverting it. This does not adopt #112375 or #158244.

Transport initiation boundaries

Every application retry prepares a fresh use. Provider response settlement does not hold the interval.

Path Initiation boundary Remaining window
Shared guarded HTTP Fetch after DNS/proxy preparation and final synchronous guards Fetch implementation and networking
Discord Fetch after REST scheduler waits; configured endpoints restore scope into shared guarded HTTP Fetch or injected implementation
Slack SDK fetch callback after queue waits; scoped clients retain their originating operation Fetch implementation and networking
Telegram Each Undici dispatcher submission; raw injected fetch at callback handoff Undici or injected implementation
Internal-source transcript Existing worker transaction/commit, after media preparation Interval remains held through native settlement

Retained migration debt: the synchronous cron guard at src/cron/service/run-receipts.ts:170 still calls src/cron/store/run-receipt-store.ts:553, as authorized for this additive stage. Existing replay checks in src/gateway/internal-source-reply-persistence.ts:97–98 read the session row and transcript anchor after commit/publication. Placement, session-generation and approval-lease assertions inspected here consume prepared/in-memory authority. No new host SQL is added.

Evidence

Focused local runs use --maxWorkers=1; wall times include the repository runner and imports. CI time is not yet measured; these local durations are the current cost estimate.

Proof Result / wall time
Original failing consumer cron selection 59 tests / 3 files passed; 400.28 s
Core transport selection (Discord, Slack, Telegram) 148 tests / 10 files passed; 365.47 s
Final Slack cache/workspace regression selection 38 tests / 4 files passed; 282.77 s
Repaired entry-point, owner and public-SDK test boundaries (before foundation integration) 48 tests / 3 files passed; 477.36 s (integration 208.79 s, owner 112.12 s, Slack 43.92 s)
Integrated Discord REST and receipt-store replay 71 tests / 2 files passed; 359.95 s
Integrated lifecycle/import replay 60 tests / 10 files passed; 888.12 s, including all required import/closure suites
Main integration replay 49 tests / 8 files passed; 436.91 s. Replays owner, source-reply/tool/RPC, CLOSE-PRELUDE and required import/closure suites after the main merge.
Shared-registry import rule Runtime process build graph 10 tests, get-reply import closure 1, state-worker imports 2, cron dispatch imports 5, wrapper closure 3; all passed
Real server CLOSE-PRELUDE Passed against main; 5.790 s test body (37.78 s file wall time)
Changed checks Passed on the staged main-merge candidate; 1,942.38 s. Line caps, zero environment-name growth, types, core/extensions/scripts lint, export scans, and boundary/schema guards are green.
Madge 0 cycles at lane commit fb54dc0; 35.11 s. Fresh main-merge runtime value-cycle check: 0 cycles, 53.72 s
Database worker ratchet Passed against pinned main 0068b18116bfefed780b1eef840733284944685e
Local SDK diff Passed locally using realpath TMPDIR; 1,402.66 s at integrated commit 15410c7. All 127 affected exports retain identical direct declarations and kinds; only optional prepareUse/new reachable effect definitions change. The later internal error-leaf extraction and callback binding renames do not change this SDK surface; the main merge leaves all lane code/test files unchanged. This is prior-head SDK evidence, not a final-merge SDK build.
Final build Passed at 6fe286d; 2,469.72 s. Later lane source changes only rename three shadowed local callback bindings without changing runtime behavior; the subsequent main merge imports upstream work and leaves all lane code/test files unchanged. This build predates that merge. UI build reported a non-blocking startup JS budget overage of 39 B; no claim of a passing UI performance budget.
Final error-leaf repair 29 tests / 3 files passed; 174.67 s; all three export scans passed (186.79 s)
Final core/extension lint Passed; 343.56 s including package-boundary artifact admission
Fresh Codex autoreview through P2 Scoped-clean for the staged main merge against pinned 0068b181; 222.37 s

The original 11-failure cron cascade came from synchronous fixture closes that left admission poisoned; those fixtures now await the database owner, with that repair included in the integrated foundation. The remaining core failure was a close test using a nonexistent scheduler API; it now drives the real scheduler. Two new direct/RPC rows were moved into the existing broker-capable integration suite instead of forcing a thread-pool override. Slack's tests use the public SDK boundary; real scope retirement is proved at the receipt owner.

Controlled worker/deferred gates cover commit/reply suspension (cases 1–2), initiation versus queued mutation and provider response (6), owner custody/ABA/partition separation (7), operational identity (11), message/source separation (12), force-disabled and non-revival semantics (13), provider preparation/retry/disclosure and source transcript commit (18), and real close order. Cross-process routing with a killed authority host and the exhaustive wrong-handle matrix are not claimed by this stage. Direct SQLite writers are outside the accepted contract.

Negative controls reproduced the two substantive source-reply defects: an assistant row committed after admission closed, and the persistence interval was already held during remote-media preparation. A Slack negative control reproduced loss of listener workspace binding on cold scoped-client creation. Final repairs passed. Zero caller-thread SQL instrumentation covers prepared-use preparation/assertion/initiation; it does not cover the retained legacy checker.

The Telegram lifetime P2 finding was evaluated against the unchanged caller: extensions/telegram/src/fetch.ts:676 constructs the transport wrapper inside each resolvedFetch request (line 666), and only that invocation's fallback attempts reuse it. The final independent review confirmed this request-local lifetime.

Static T1 against pinned main 0068b181: 902 → 902 (272 files), with no inventory reclassification. The earlier foundation measured 914 → 914; the reduction between foundations belongs to upstream work. Survey R2 is exposure, not a promise to delete two expressions; R6 standing-grant lookup belongs to cron 3/3. The retained native checker also makes this an explicitly incomplete SQL cutover.

The same text-only mock cron tick completed successfully before and after. Its delivery mode is none, and it makes no message-tool call. The baseline is the early contract commit; the after run is commit 6fe286d, followed by behavior-preserving lane binding renames and the main merge described above. The later foundation/main integration and host load make aggregate deltas unsuitable for attributing savings to this lane.

Cron phase measurement Before After
Wall time 37.187 s 10.719 s
Host SQL statements 1,607 1,582
Host prepares (separate) 546 553
Worker SQL statements 3,796 3,682
Helper SQL statements 29 16
Native message-guard statements 0 0

No message-guard SQL savings claim follows from this fixture. The baseline had four lock failures during connect, outside the cron phase; the after run had none. The isolated Gateway shut down cleanly and all harness-owned children were stopped.

Production: +653 / −111 / net +542 (764 changed lines, including the earlier held-use commit). Tests/support: +1,093 / −32. Docs: +26 / −2. Tooling: +1 / −1.

Final-head published-driver × candidate update proof passed; see landing qualification below. This remains the additive 2a stage and does not start 2b.

Landing repairs and additional qualification

Commit 536f33a9dc64df165d867cf6e0c20250f68500dd repairs the PR-caused failures from CI run 37203096745. Discord again supplies two arguments to an unguarded custom fetch callback; guarded requests retain their live assertion. Telegram refuses deferred dispatch by cancelling the request signal, which cancels unread uploads and preserves the original local-authority error through HTTP 421 fallback. The new real-HTTP regression failed before this repair on both upload cleanup and double-wrapped refusal identity.

The repaired candidate passes 108 focused Discord/Telegram tests across five files (--maxWorkers=1, 192.68 s local wrapper wall time), four suppression-inventory tests (50.91 s), extension production/test types, targeted lint, formatting, the raw-channel-fetch guard, and a fresh full-candidate Codex autoreview through P2. Final-head CI cost is recorded below.

A separate composed proof uses a real persisted cron receipt, an admitted run and the Gateway receipt owner with production resolveTelegramTransport, createTelegramClientFetch, and grammY. An allowed send reaches an isolated HTTP Bot API fixture. A tool-policy update then commits while the proof pauses immediately before the real owner's prepareUse; releasing that pause produces an authority refusal and zero denied network effects. This is a controlled owner-to-transport boundary proof, not a claim that the pause is a provider queue or that the fixture is Telegram's Test Server. The isolated state, transport, process and listener were cleaned up. Scoped live Test Server receipt-to-transport proof subsequently passed; its separate announcement limitation is recorded below.

The released SDK check also compared v2026.9.8 source: existing captureChannelReadAuthority stays synchronous with the same signature; captureEffectAuthority is additive. The changed route-authority callback is internal, not exported through src/plugin-sdk, api.runtime, or a documented SDK subpath. No released signature is removed or changed, so no deprecation compatibility record is needed. The existing local SDK diff report above remains applicable; the landing repair only changes private transport implementations and tests.

The six embedded-agent failures have independently matching failures on the exact merge-base's scheduled main CI run 37200643847: run.inherited-auth-owner, run.session-permissions, and run.prepared-harness-credentials fail with Agent admission requires its host owner; run.recovery-deadline, run.terminal-timeout-delivery.integration, and run.plugin-runtime-refresh.integration fail their workspace-consumer teardown assertion. The tested setup/owner sources are unchanged by this PR. Five single-file repetitions on each side are complete; final-head CI and native admin admission retain inherited failures as failures.

The actual retry boundary is now also qualified on 536f33a9: with a fresh real receipt, production Telegram transport/client and grammY, Undici's own HTTP 421 retry performs prepare → request → 421 → prepare → request → 200. In a separate fresh-receipt case, the fixture commits a real service tool-policy revocation before releasing the first 421 response. The native retry then calls the real owner again and is refused: two preparation attempts, one wire request, zero network effects after revocation. No custom retry implementation or mocked authority is involved. Both receipts settle; transports, listeners, processes and isolated state are cleaned up. This remains HTTP-fixture boundary proof, separate from the live Test Server qualification below.

Changed-test cost: pnpm test extensions/telegram/src/bot.fetch-abort.test.ts --maxWorkers=1 passes all 16 cases in 8.89 s wall time. The final-head Telegram CI job reports 0.139 CI seconds summed across that file's case bodies, including 0.047 s for the three new cases; these exclude shared runner/import overhead. Final CI confirms all repaired transport, suppression, and boundary jobs plus security-fast passed. Its only red roots are the three independently attributed embedded-agent jobs and their downstream gate; none were rerun for a passing result.

Final landing qualification

The final-head published-driver update cell passed on Blacksmith Testbox run 37204866738. Published 2026.9.8 installed candidate build 536f33a9dc64, recorded a finished/succeeded durable update in 171.931 s, restarted the managed Gateway, returned readiness 200, and reported serviceRestartSafe: true. The candidate archive SHA-256 is cfd0571f7f6ff1f2d50b0ed5cfd6292b97ce7888d7a8bc141f5bac2418c59870. The product cell ran once; an earlier proof-command preflight was corrected before building. The owned service and Testbox lease are stopped. This final build had a 26 B report-only startup-JS budget warning; no passing performance-budget claim is made.

The requested 100 single-file comparisons completed on Testbox run 37204721572, each with --maxWorkers=1: all six embedded-agent files failed five times on the merge base and five times on the original PR head. Discord endpoint/listener, Telegram HTTP, and suppression-inventory files each passed five times on baseline and failed five times on the original head, supporting the repairs. Total test wall time was 1,895 s. Artifact export timed out after execution; all 100 unique result rows were recovered and verified, but individual full repetition logs were unavailable. Independent main/final-PR CI logs retain the exact failure signatures. The lease is stopped.

Live Telegram Test Server authority proof passed on the final source: a real persisted receipt, admitted run, actual prepareUse, and production Telegram client sent one allowed marker that the TDLib user recorder observed. After committed policy revocation, preparation refused the denied send and no denied marker appeared in the completed recording. Credentials and the lease were released; owned processes, listeners and isolated state were cleaned up. This command directly exercises the receipt-to-transport boundary. The recorder's separate optional cron-announcement action was blocked before its RPC by the source CLI runtime-artifact publication guard's LaunchAgent inspection refusal, so the overall recorder exited 1 and neither that announcement nor live message-tool dispatch is claimed. That fixture limitation is separate from the successful scoped live authority result and the native HTTP 421 retry proof.

Final CI 37204482124 has exactly three inherited failed jobs plus their downstream aggregate gate, with no cancelled jobs. All repaired transport/tooling/boundary jobs and security-fast passed. The native inherited-failure evidence binds test merge 0eb7e819e563d15d6151028c44d5b1e988bacc13, its ordered parents, matching merge tree, unchanged failure inputs, independent main failures, and scoped passing checks. No failed CI or tooling/fixture outcome is relabeled green.

Bind prepared effects to exact receipt facts and the existing Gateway-owned
FIFO. Keep repeatable assertions separate from one-shot native initiation,
and release exclusion before awaiting the provider response.

Allow a use to borrow its own gate for consumption while preserving native
publication and settlement. Closing retires unused effects and joins accepted
borrowed persistence independently of scheduler cancellation.

This additive interface supports the message and standing-grant cutovers;
it does not activate either consumer or change schema, retention, or policy.
Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for #164805.
Merge main to resolve the Gateway close-prelude conflict while retaining
cron receipt admission sealing before scheduler cancellation and main's
model-account shutdown fence and settlement join.

Focused real-close proof: cron receipt publication/finalization and an
accepted personal model-account write both pass (2 tests, 521.35s wrapper
wall on the loaded local host). Receipt semantics, eligibility, and storage
schemas are unchanged.
Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.
Merge main through 8cabfb2, including the
three read-admission fixture fixes proved while investigating this PR's CI.
The merge is conflict-free; only worker-access documentation overlaps the
cron-specific delta, preserving both sections. The cron receipt-authority
delta and package manifests remain unchanged by this integration.

The main repair reproduced all three failures five times each, then passed
89 tests, scoped checks, and P2 review. The earlier close-prelude resolution
passed both real-close regressions, and the dashboard drain passed its full
34-case owner file. Final-head package/update and standing-grant proof remain
required before merge.
@clawsweeper

clawsweeper Bot commented Oct 4, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: slack Channel integration: slack channel: telegram Channel integration: telegram gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 4, 2026
@clawsweeper clawsweeper Bot added the status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. label Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 9:55 AM ET / 13:55 UTC (Revision 4).

ClawSweeper review

What this changes

The PR retains Gateway-owned scheduled-message authority through transport preparation, retries, read acceptance, and internal reply transcript commits.

Merge readiness

✅ Ready for maintainer review

This remains a distinct, useful authority fix. The added evidence resolves both previous proof requests, and no blocking introduced defect was found.

Priority: P2
Reviewed head: 536f33a9dc64df165d867cf6e0c20250f68500dd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-based repair with relevant live and negative-path proof, preserved compatibility, and no blocking correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The hash-matched full body supplies final-head receipt-owner-to-production-Telegram proof: allowed Test Server delivery, committed-revocation refusal with no denied delivery, and native HTTP 421 retry refusal before another wire request. Supplemental commit-boundary controls cover internal transcripts. The optional announcement failure does not invalidate that scoped proof. Final-head published-driver update evidence resolves the earlier upgrade request; no stored-data contract changes were introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The hash-matched full body supplies final-head receipt-owner-to-production-Telegram proof: allowed Test Server delivery, committed-revocation refusal with no denied delivery, and native HTTP 421 retry refusal before another wire request. Supplemental commit-boundary controls cover internal transcripts. The optional announcement failure does not invalidate that scoped proof. Final-head published-driver update evidence resolves the earlier upgrade request; no stored-data contract changes were introduced.
Evidence reviewed 8 items Pinned introduction and current-main necessity: Reviewed the introduced delta from 0068b18 to the exact original head. Current main has the receipt-publication foundation but lacks acquireUse and the held-effect consumer integration. The merged foundation does not supersede this work.
Owner-held final authority: Prepared uses validate the exact receipt, current job permissions, database admission, and caller lifetime. Initiation spends the use once; persistence retains the interval through settlement. Close retires outstanding uses while joining accepted work.
Telegram retry and refusal boundary: Each dispatcher submission reacquires authority before dispatch, including native HTTP 421 retries. Refusal aborts the request signal to clean up unread uploads and preserves the local authority error. The unchanged transport caller creates this wrapper separately for each resolvedFetch invocation.
Findings None None.
Security None None.

How this fits together

Cron admits scheduled agent runs using persisted receipts and current job permissions. The Gateway authority owner coordinates those permissions with channel requests and transcript writes so revoked runs cannot start new effects.

flowchart TD
  A[Scheduled agent run] --> B[Gateway receipt owner]
  C[Committed job changes] --> B
  B --> D[Prepare current authority]
  D --> E[Transport queue or retry]
  E --> F[Authorized provider request]
  D --> G[Guarded transcript commit]
  B --> H[Refuse revoked work]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +552, Tests +1139, Docs +24, Other 0. Total +1715 across 39 files.

View PR surface stats
Area Files Added Removed Net
Source 25 663 111 +552
Tests 10 1172 33 +1139
Docs 2 26 2 +24
Config 0 0 0 0
Generated 0 0 0 0
Other 2 1 1 0
Total 39 1862 147 +1715

Review metrics

Metric Value Why it matters
Ownership implementation growth Production net +552 lines; tests/support net +1,139 lines The growth implements the shared held-use owner and transport adapters, with distinct owner, commit, queue, and cleanup regressions.

Technical review

Best possible solution:

Keep receipt authority with the existing Gateway owner through final initiation and commit, preserving compatibility during the documented remaining transport cutover.

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

Yes: source and failing-first controls identify revocation during transport preparation or immediately before transcript commit. This read-only review did not execute a reproduction.

Is this the best way to solve the issue?

Yes: extending the existing receipt owner avoids competing authority state, and the adapters retain existing transport and SDK contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The hash-matched full body supplies final-head receipt-owner-to-production-Telegram proof: allowed Test Server delivery, committed-revocation refusal with no denied delivery, and native HTTP 421 retry refusal before another wire request. Supplemental commit-boundary controls cover internal transcripts. The optional announcement failure does not invalidate that scoped proof. Final-head published-driver update evidence resolves the earlier upgrade request; no stored-data contract changes were introduced.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This is a bounded scheduled-message authority repair with no demonstrated current emergency.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The hash-matched full body supplies final-head receipt-owner-to-production-Telegram proof: allowed Test Server delivery, committed-revocation refusal with no denied delivery, and native HTTP 421 retry refusal before another wire request. Supplemental commit-boundary controls cover internal transcripts. The optional announcement failure does not invalidate that scoped proof. Final-head published-driver update evidence resolves the earlier upgrade request; no stored-data contract changes were introduced.
  • proof: sufficient: Contributor real behavior proof is sufficient. The hash-matched full body supplies final-head receipt-owner-to-production-Telegram proof: allowed Test Server delivery, committed-revocation refusal with no denied delivery, and native HTTP 421 retry refusal before another wire request. Supplemental commit-boundary controls cover internal transcripts. The optional announcement failure does not invalidate that scoped proof. Final-head published-driver update evidence resolves the earlier upgrade request; no stored-data contract changes were introduced.

Evidence

What I checked:

  • Pinned introduction and current-main necessity: Reviewed the introduced delta from 0068b18 to the exact original head. Current main has the receipt-publication foundation but lacks acquireUse and the held-effect consumer integration. The merged foundation does not supersede this work. (src/cron/store/receipt-authority-owner.ts:237, 536f33a9dc64)
  • Owner-held final authority: Prepared uses validate the exact receipt, current job permissions, database admission, and caller lifetime. Initiation spends the use once; persistence retains the interval through settlement. Close retires outstanding uses while joining accepted work. (src/cron/store/receipt-authority-owner.ts:264, 536f33a9dc64)
  • Telegram retry and refusal boundary: Each dispatcher submission reacquires authority before dispatch, including native HTTP 421 retries. Refusal aborts the request signal to clean up unread uploads and preserves the local authority error. The unchanged transport caller creates this wrapper separately for each resolvedFetch invocation. (extensions/telegram/src/request-authority.ts:70, 536f33a9dc64)
  • Captured body identity and authority proof: Fetched the omitted body and verified all 17,606 characters against captured SHA-256 9663eb7a08af2143d4511b4a3e0671e33e9730cbc67add60b0b7e145571eae1e. Its final-head proof composes real receipts, admission, prepareUse, production Telegram transport/client, and grammY: allowed Test Server delivery was observed by the TDLib recorder; committed revocation refused preparation with no denied marker. Separate real HTTP 421 proof records two preparations but only one wire request after revocation. The optional announcement failed before RPC; neither announcement nor live message-tool dispatch is claimed. (536f33a9dc64)
  • Previous update-proof request resolved: The matching captured body reports published 2026.9.8 installing candidate build 536f33a, a finished/succeeded durable update in 171.931 seconds, managed Gateway restart, readiness 200, and serviceRestartSafe=true. Candidate archive SHA-256 is cfd0571f7f6ff1f2d50b0ed5cfd6292b97ce7888d7a8bc141f5bac2418c59870. https://github.com/openclaw/openclaw/actions/runs/37204866738 is the Testbox carrier; its overall cancelled conclusion is separate from the reported completed product cell and stopped lease. (536f33a9dc64)
  • Compatibility and staged scope: The SDK adds captureEffectAuthority while retaining captureChannelReadAuthority and existing synchronous signatures. Documentation describes the generic capture/restore/initiate contract and expressly retains other transports' synchronous guards. No schema, serialized format, configuration option, or dependency changes appear in the introduced delta; the existing native checker remains at line 170. Public docs: docs/plugins/sdk-channel-plugins.md. (docs/plugins/sdk-channel-plugins.md:761, 536f33a9dc64)

Likely related people:

  • steipete: 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-04T12:52:01.893Z sha 38586e9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-04T13:14:41.673Z sha 536f33a :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-04T13:29:31.564Z sha 536f33a :: blocked before merge. :: none

…4906)

Keep unguarded Discord fetch callbacks on their existing two-argument path.
Cancel Telegram's deferred request through its AbortSignal when authority
refuses initiation, so unread uploads are cleaned up and the original
local-authority error survives retries without being wrapped twice.

The real HTTP regression fails before the repair on unread upload cleanup
and refusal identity. Focused Discord/Telegram proof passes 108 tests;
the suppression inventory passes 4 tests. Extension production/test types,
targeted lint, formatting and the raw-channel-fetch guard pass.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 4, 2026
@steipete
steipete merged commit 9a7b4da into main Oct 4, 2026
186 of 192 checks passed
@steipete
steipete deleted the dbasync/cron2 branch October 4, 2026 13:56
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Oct 4, 2026
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

steipete added a commit that referenced this pull request Oct 5, 2026
…elete the native checker (cron 2b/3) (#165129)

* refactor(cron): publish receipt authority from the Gateway owner

* fix(cron): preserve SDK admission factory contracts

* fix(cron): settle receipt authority before releasing close custody

* refactor(cron): add held receipt authority uses

Bind prepared effects to exact receipt facts and the existing Gateway-owned
FIFO. Keep repeatable assertions separate from one-shot native initiation,
and release exclusion before awaiting the provider response.

Allow a use to borrow its own gate for consumption while preserving native
publication and settlement. Closing retires unused effects and joins accepted
borrowed persistence independently of scheduler cancellation.

This additive interface supports the message and standing-grant cutovers;
it does not activate either consumer or change schema, retention, or policy.

* fix(cron): retain approval authority through publication

Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for #164805.

* test(sessions): drain publication before durability close

Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.

* refactor(cron): hold message authority through core transport initiation

* refactor(cron): define held-use refusal in a shared error leaf

* style(cron): disambiguate authority callback bindings

* fix(cron): preserve transport refusal and cancellation semantics (#164906)

Keep unguarded Discord fetch callbacks on their existing two-argument path.
Cancel Telegram's deferred request through its AbortSignal when authority
refuses initiation, so unread uploads are cleaned up and the original
local-authority error survives retries without being wrapped twice.

The real HTTP regression fails before the repair on unread upload cleanup
and refusal identity. Focused Discord/Telegram proof passes 108 tests;
the suppression inventory passes 4 tests. Extension production/test types,
targeted lint, formatting and the raw-channel-fetch guard pass.

* refactor(cron): hold authority across remaining transport handoffs

Complete the bundled message transport cutover and remove the native current-job checker. Preserve exact receipt authority, release at SDK or CLI initiation, and retain refusal identity. Shared SQL kernels remain worker or Doctor owned.

* test(cron): preserve generic authority fixtures

Keep the Nostr handoff fixture generic without a cast and document the WhatsApp SDK initiation window.

* test(cron): normalize transport authority regression fixtures

* test(clickclack): isolate authority handoff regressions

* test(nostr): observe the production relay handoff

* test(cron): keep Synology handoff cases lint-clean

* docs(cron): remove superseded native-checker migration note

* fix(cron): clear receipt cutover lint and documentation gates

Bind the loopback socket writer's call to the original method, retaining the
socket receiver, and remove shadowed bindings. Regenerate the assertion
baseline after the LINE cleanup removes one assertion. Remove the remaining
obsolete statement that final message SQL guards await migration.

The IRC owner tests pass (41 tests, 69.26 seconds overall), and the bounded
P2 review is clean. The assertion baseline shrinks by exactly one. Local
type-aware lint stopped at declaration preparation's 300-second timeout;
the Linux full changed check remains required before merge.

* test(cron): bind native write faults after socket connection

Scope the IRC fault to the real client socket, install it after Node's connect
restores write, and preserve the method's boolean return type. Synchronize
and restore Node's connection-factory exports around the fixture. Use the
canonical Teams channel-result helper when aggregating earlier receipts.

Validation: all 22 IRC client tests pass (46.70 seconds overall), all 26 Teams
outbound tests pass (131.13 seconds overall), and the bounded P2 review is
clean. The full Linux changed check remains required before publication.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…e transports (cron 2a/3) (openclaw#164906)

* refactor(cron): publish receipt authority from the Gateway owner

* fix(cron): preserve SDK admission factory contracts

* fix(cron): settle receipt authority before releasing close custody

* refactor(cron): add held receipt authority uses

Bind prepared effects to exact receipt facts and the existing Gateway-owned
FIFO. Keep repeatable assertions separate from one-shot native initiation,
and release exclusion before awaiting the provider response.

Allow a use to borrow its own gate for consumption while preserving native
publication and settlement. Closing retires unused effects and joins accepted
borrowed persistence independently of scheduler cancellation.

This additive interface supports the message and standing-grant cutovers;
it does not activate either consumer or change schema, retention, or policy.

* fix(cron): retain approval authority through publication

Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for openclaw#164805.

* test(sessions): drain publication before durability close

Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.

* refactor(cron): hold message authority through core transport initiation

* refactor(cron): define held-use refusal in a shared error leaf

* style(cron): disambiguate authority callback bindings

* fix(cron): preserve transport refusal and cancellation semantics (openclaw#164906)

Keep unguarded Discord fetch callbacks on their existing two-argument path.
Cancel Telegram's deferred request through its AbortSignal when authority
refuses initiation, so unread uploads are cleaned up and the original
local-authority error survives retries without being wrapped twice.

The real HTTP regression fails before the repair on unread upload cleanup
and refusal identity. Focused Discord/Telegram proof passes 108 tests;
the suppression inventory passes 4 tests. Extension production/test types,
targeted lint, formatting and the raw-channel-fetch guard pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…elete the native checker (cron 2b/3) (openclaw#165129)

* refactor(cron): publish receipt authority from the Gateway owner

* fix(cron): preserve SDK admission factory contracts

* fix(cron): settle receipt authority before releasing close custody

* refactor(cron): add held receipt authority uses

Bind prepared effects to exact receipt facts and the existing Gateway-owned
FIFO. Keep repeatable assertions separate from one-shot native initiation,
and release exclusion before awaiting the provider response.

Allow a use to borrow its own gate for consumption while preserving native
publication and settlement. Closing retires unused effects and joins accepted
borrowed persistence independently of scheduler cancellation.

This additive interface supports the message and standing-grant cutovers;
it does not activate either consumer or change schema, retention, or policy.

* fix(cron): retain approval authority through publication

Recheck standing-grant expiry after receipt publication and retain the
caller's live approval scope while persistence settles independently.
Permit only guarded consumption of an already-recorded handoff during close.

Align fixtures with async database custody and the single Gateway writer,
preserve admission identity during receipt-loss injection, and keep generic
detached-exec tests from cold-loading an unrelated channel runtime.

Receipt semantics, eligibility, schema, ledger, retention, and released SDK
signatures remain unchanged. Final-head published-driver update proof is
still a merge precondition for openclaw#164805.

* test(sessions): drain publication before durability close

Wait for the saved dashboard row publication before deliberately closing its database for the durability probe. Retain every close/reopen and live-authority assertion. Full owner file: 34 passed, 241.25s wrapper wall; fresh P2 review clean.

* refactor(cron): hold message authority through core transport initiation

* refactor(cron): define held-use refusal in a shared error leaf

* style(cron): disambiguate authority callback bindings

* fix(cron): preserve transport refusal and cancellation semantics (openclaw#164906)

Keep unguarded Discord fetch callbacks on their existing two-argument path.
Cancel Telegram's deferred request through its AbortSignal when authority
refuses initiation, so unread uploads are cleaned up and the original
local-authority error survives retries without being wrapped twice.

The real HTTP regression fails before the repair on unread upload cleanup
and refusal identity. Focused Discord/Telegram proof passes 108 tests;
the suppression inventory passes 4 tests. Extension production/test types,
targeted lint, formatting and the raw-channel-fetch guard pass.

* refactor(cron): hold authority across remaining transport handoffs

Complete the bundled message transport cutover and remove the native current-job checker. Preserve exact receipt authority, release at SDK or CLI initiation, and retain refusal identity. Shared SQL kernels remain worker or Doctor owned.

* test(cron): preserve generic authority fixtures

Keep the Nostr handoff fixture generic without a cast and document the WhatsApp SDK initiation window.

* test(cron): normalize transport authority regression fixtures

* test(clickclack): isolate authority handoff regressions

* test(nostr): observe the production relay handoff

* test(cron): keep Synology handoff cases lint-clean

* docs(cron): remove superseded native-checker migration note

* fix(cron): clear receipt cutover lint and documentation gates

Bind the loopback socket writer's call to the original method, retaining the
socket receiver, and remove shadowed bindings. Regenerate the assertion
baseline after the LINE cleanup removes one assertion. Remove the remaining
obsolete statement that final message SQL guards await migration.

The IRC owner tests pass (41 tests, 69.26 seconds overall), and the bounded
P2 review is clean. The assertion baseline shrinks by exactly one. Local
type-aware lint stopped at declaration preparation's 300-second timeout;
the Linux full changed check remains required before merge.

* test(cron): bind native write faults after socket connection

Scope the IRC fault to the real client socket, install it after Node's connect
restores write, and preserve the method's boolean return type. Synchronize
and restore Node's connection-factory exports around the fixture. Use the
canonical Teams channel-result helper when aggregating earlier receipts.

Validation: all 22 IRC client tests pass (46.70 seconds overall), all 26 Teams
outbound tests pass (131.13 seconds overall), and the bounded P2 review is
clean. The full Linux changed check remains required before publication.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord channel: slack Channel integration: slack channel: telegram Channel integration: telegram docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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