Skip to content

fix(cron): retry proven-not-sent channel resolution failures in announce delivery - #135985

Merged
obviyus merged 2 commits into
openclaw:mainfrom
gaoanze888:fix/channel-resolve-retry
Sep 2, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
gaoanze888:fix/channel-resolve-retry

Conversation

@gaoanze888

@gaoanze888 gaoanze888 commented Sep 2, 2026 •

Copy link
Copy Markdown

Closes #135836

What Problem This Solves

Cron direct delivery and subagent completion announce treated a retryable, proven-not-dispatched channel adapter miss as permanent text. Both stopped after one attempt instead of using the existing 5s, 10s, and 20s retry schedule.

Why This Change Was Made

createChannelHandler raises PlatformMessageNotDispatchedError before adapter dispatch when no outbound handler resolves. That type proves no recipient-visible send began and defaults to retryable: true.

The shared delivery owner now resolves typed no-send retryability before caller-specific text rules. It returns no decision for untyped pre-connect errors, so existing permanent-text ordering remains unchanged.

The same shared predicate now serves normal reply dispatch, cron delivery, and subagent announce. It rejects retryable: false, partial or prior-send evidence, ambiguous retry branches, and nested visible-send receipts.

The production increase is +58/-30 lines (net +28). The growth creates the shared owner boundary and removes the prior private duplicate from reply dispatch.

User Impact

A temporarily unavailable adapter can become available during the configured direct retry window. Cron output and subagent completion delivery then reach the target instead of being abandoned after one local resolution failure.

Retry timings and configuration do not change. Ambiguous or already-dispatched failures still do not retry.

Evidence

Production-boundary harness, same input on both revisions:

  • Baseline main 071e3b0e1099b8cfbf4d0c369dd5a6d409911e2a: the registered Slack adapter stayed unavailable until attempt 4; cron and subagent announce each stopped after attempt 1; the adapter recorded no payload; subagent outcome was permanent_failure.
  • Repaired head 1e6bb032acabbb387aa6492e85e54c402009473e: the same adapter became available only on attempt 4; both callers made 4 attempts; the adapter recorded one visible completion payload; subagent outcome was delivered: true.
  • Anti-cheat: the harness changed only adapter availability on attempt 4. It did not fabricate or inject the delivery error. Production createChannelHandler produced the error on attempts 1-3.
  • Scope: this used the real production adapter registry, handler resolution, outbound delivery, cron retry, and subagent announce flow with an in-memory channel adapter. It did not call the external Slack API.

Focused exact-head tests:

  • src/infra/delivery-recovery.shared.test.ts: 11 passed.
  • src/infra/outbound/delivery-queue.policy.test.ts: 5 passed.
  • src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts: 30 passed.
  • src/agents/subagents/announce/subagent-announce-delivery.test.ts: 242 passed.
  • src/gateway/server-cron.test.ts: 120 passed.
  • Formatter, conflict-marker scan, coercion guard, and targeted Oxlint passed.

Type checking was left to CI because repository policy forbids local OpenClaw type-check runs on this host.


This PR was prepared with AI assistance; the fix, tests, and evidence were reviewed by the author and maintainer.

…nce delivery

A momentarily unresolvable channel adapter raises
PlatformMessageNotDispatchedError("Outbound not configured for channel: ...")
with retryable=true and isProvenDeliveryNotSentError=true. Both the cron
direct-delivery and subagent announce classifiers matched that message against
a permanent-error regex list first, so they abandoned the message on attempt 1
instead of running the configured [5s, 10s, 20s] retry schedule.

Drop the "/outbound not configured for channel/i" pattern from both permanent
lists. Cron then falls through to isProvenDeliveryNotSentError; announce gets an
explicit proven-not-sent branch so its allowlist-gated retry wrapper admits the
error.
@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 2, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 7:29 AM ET / 11:29 UTC.

ClawSweeper review

What this changes

The PR centralizes typed no-send retry classification so cron, subagent completion announcements, and normal reply dispatch retry channel-adapter resolution failures that occurred before any message was sent.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: current main still abandons typed no-send adapter-resolution failures before retry, while the branch centralizes the established no-send decision and supplies convincing exact-head production-boundary proof.

Priority: P1
Reviewed head: 1e6bb032acabbb387aa6492e85e54c402009473e

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Strong production-boundary proof and focused cross-caller coverage support a clean canonical repair.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed owner is the shared no-send classifier consumed by the cron and subagent retry wrappers; the PR supplies an exact-head production-boundary trace through real adapter resolution and outbound delivery where availability changes only on attempt four, producing the observed four attempts and one visible completion.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed owner is the shared no-send classifier consumed by the cron and subagent retry wrappers; the PR supplies an exact-head production-boundary trace through real adapter resolution and outbound delivery where availability changes only on attempt four, producing the observed four attempts and one visible completion.
Evidence reviewed 7 items Current-main defect: The current main classifier checks permanent message text before its proven-no-send predicate, so the adapter-resolution error is not retried.
Producer contract: A missing outbound handler throws PlatformMessageNotDispatchedError before dispatch; the error defaults to retryable unless explicitly marked false.
Canonical branch repair: The new shared helper requires a typed marker, full no-send proof, and no send evidence; cron and announce apply it before legacy text heuristics while reply dispatch replaces its duplicate predicate.
Findings None None.
Security None None.

How this fits together

Cron jobs, subagent completions, and replies send through channel adapters. Their delivery wrappers use error classification to choose between a bounded retry schedule and a terminal outcome.

flowchart LR
  A[Cron, reply, or subagent completion] --> B[Outbound delivery]
  B --> C[Channel adapter resolution]
  C --> D{No-send error classification}
  D -->|Retryable typed failure| E[Bounded retry schedule]
  D -->|Permanent or send evidence| F[Terminal delivery outcome]
  E --> B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +28, Tests +77. Total +105 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 58 30 +28
Tests 3 90 13 +77
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 148 43 +105

Review metrics

Metric Value Why it matters
Production versus test delta production +58/-30 (net +28); tests +90/-13 (net +77) The added shared decision owner replaces a 27-line reply-local duplicate and is exercised at the shared helper plus cron and subagent boundaries.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #135836
Summary: This PR is the candidate repair for the canonical direct-delivery retry defect; the earlier queue repair addressed an adjacent durable-delivery surface.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Land one shared typed no-send classifier that retains caller-specific handling for untyped errors and refuses retries whenever a send or explicit permanent rejection is evidenced.

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

Yes—current main source establishes the error producer and both premature permanent classifications, and the PR supplies a real production-boundary before/after trace for the retry path.

Is this the best way to solve the issue?

Yes—the shared predicate removes duplicated reply logic while preserving each caller's existing untyped-error policy and explicit no-duplicate safeguards.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed owner is the shared no-send classifier consumed by the cron and subagent retry wrappers; the PR supplies an exact-head production-boundary trace through real adapter resolution and outbound delivery where availability changes only on attempt four, producing the observed four attempts and one visible completion.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed owner is the shared no-send classifier consumed by the cron and subagent retry wrappers; the PR supplies an exact-head production-boundary trace through real adapter resolution and outbound delivery where availability changes only on attempt four, producing the observed four attempts and one visible completion.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove merge-risk: 🚨 message-delivery: Current PR review selected no merge-risk labels.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: Without this repair, cron and subagent completion notifications can be abandoned after a recoverable pre-dispatch adapter-resolution failure.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed owner is the shared no-send classifier consumed by the cron and subagent retry wrappers; the PR supplies an exact-head production-boundary trace through real adapter resolution and outbound delivery where availability changes only on attempt four, producing the observed four attempts and one visible completion.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed owner is the shared no-send classifier consumed by the cron and subagent retry wrappers; the PR supplies an exact-head production-boundary trace through real adapter resolution and outbound delivery where availability changes only on attempt four, producing the observed four attempts and one visible completion.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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 (1 earlier review cycle)
  • reviewed 2026-09-02T05:46:04.758Z sha 93c6c55 :: needs real behavior proof before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 2, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 2, 2026
@obviyus
obviyus merged commit 47849c2 into openclaw:main Sep 2, 2026
432 of 537 checks passed
@obviyus

obviyus commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks @gaoanze888!

Proof: A production-boundary harness kept the Slack adapter unavailable until attempt 4. Current main stopped after attempt 1 with no send. The landed head used all 4 attempts, sent one visible completion, and reported subagent delivery as delivered.

  • Bug: Cron and subagent announce treated a typed, retryable, proven-not-dispatched adapter miss as permanent and abandoned delivery.
  • Fix: The shared delivery owner now resolves typed no-send retryability before legacy text rules while preserving permanent, ambiguous, and already-dispatched safeguards.
Before After
1 attempt, no payload, terminal failure 4 attempts, 1 visible payload, delivered

Landed: 47849c297b14
Source: 1e6bb032acab

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
Retry cron delivery and subagent completion announcements when a typed channel-adapter failure proves that no message was dispatched.

Centralize the typed retry decision while keeping permanent rejection, prior-send evidence, and ambiguous outcomes non-retryable.

Closes openclaw#135836.

Co-authored-by: gaoanze <gaoanze@meituan.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
jupiter221208 pushed a commit to jupiter221208/openclaw that referenced this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

cron and subagent announce delivery abandon a message on the first attempt when a channel adapter is momentarily unavailable

2 participants