Skip to content

fix(cron): current-session automations fail with "Channel is required" on webchat-only gateways - #131975

Merged
jalehman merged 2 commits into
mainfrom
openclaw/fix-automation-announce-failing-on-webchat-only-gateways
Aug 28, 2026
Merged

jalehman merged 2 commits into
mainfrom
openclaw/fix-automation-announce-failing-on-webchat-only-gateways

Conversation

@jalehman

@jalehman jalehman commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where a scheduled automation (agentTurn, sessionTarget current, default delivery mode announce) owned by a webchat/Control UI dashboard session would fail its entire run with "Channel is required (no configured channels detected)" on a gateway with no external channel plugins configured. The job auto-disabled and its report never reached the operator — a silent failure on the default path, discoverable only via the "Automation attached" badge — even though the turn result had already committed durably to the target conversation.

Why This Change Was Made

The current-session completion decided whether an external announce was still owed by string-matching webchat against the session-key prefix, which misses Control UI dashboard sessions (agent:<id>:dashboard:<uuid>), and the resulting delivery-target error was exempt from the #94058 turn-success preservation. The fix decides external-delivery necessity from the delivery resolution's recorded route instead: a failed resolution that names no deliverable external channel has nothing external backing the conversation, so the committed completion is the delivery and the run succeeds; a failed resolution that does name an external channel keeps the run successful and records the failure as the run's delivery error, distinguishing "turn succeeded, delivery failed" from "turn failed". The delivery preview mirrors the same rule instead of showing "will fail-closed" for these jobs.

User Impact

Operators running webchat-only gateways (no external channel plugins) can now schedule current-session automations with default settings: the result appears in the target conversation, the run records succeeded, and one-shot jobs clean up normally instead of auto-disabling with an error. When an external channel is configured but announce delivery fails, the run still succeeds and surfaces a distinct delivery error rather than masking the completed turn.

Evidence

  • New regression coverage: src/cron/delivery-preview.test.ts and src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts — the new tests were verified to fail on pre-fix code and pass with the fix; the two touched suites pass in full on the rebased head 6997a0cc675 (168 tests).
  • check:changed passes on the rebased head.
  • Structured autoreview (Codex, gpt-5.6-sol) on the rebased branch diff: clean, no findings.
  • Live-verified on an isolated no-channel gateway built from the pre-rebase head 3f98ec98b61: created a dashboard session, scheduled a one-shot current-target agentTurn automation with default delivery; the run committed its result to the conversation transcript, persisted lastRunStatus=succeeded, and the job auto-deleted (auto-delete only occurs after a successful run). The branch was subsequently rebased onto current main (delivery bookkeeping there was refactored by fix(cron): record real delivery outcomes and stop false-success completions #131228); post-rebase behavior is bound by the unit suites above, not by this live run.
  • The external-route-named-but-unresolvable case is covered by unit tests only (delivery-dispatch.double-announce.test.ts): the turn stays ok with the resolution failure recorded as the run's delivery error; completion follows the strict/best-effort delivery policy from fix(cron): record real delivery outcomes and stop false-success completions #131228.

@clawsweeper

clawsweeper Bot commented Aug 28, 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 docs Improvements or additions to documentation size: S maintainer Maintainer-authored PR labels Aug 28, 2026
@clawsweeper clawsweeper Bot added 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. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 6:10 PM ET / 22:10 UTC.

ClawSweeper review

What this changes

The PR fixes current-session cron automations on no-channel WebChat/Control UI gateways and preserves unavailable external routes as recorded delivery failures.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The patch correctly treats a successful current-session transcript commit as local completion when no external route exists, while preserving named unavailable external routes as delivery failures. It remains open for normal maintainer handling because it is a protected maintainer PR; no introduced correctness or security defect was found.

Priority: P1
Reviewed head: 4f1eaee0234adc98120e4520bce5c0344185caa9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The owner-boundary repair and focused regressions are strong; exact-head live confirmation remains a modest pre-landing evidence gap.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The supplied gateway run exercised a dashboard-bound current-session automation with no external route and observed transcript commit, successful status, and cleanup on a pre-rebase fix head. The final head’s unavailable-route preservation is covered by focused tests; this member-authored PR is not subject to the external-contributor proof gate.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied gateway run exercised a dashboard-bound current-session automation with no external route and observed transcript commit, successful status, and cleanup on a pre-rebase fix head. The final head’s unavailable-route preservation is covered by focused tests; this member-authored PR is not subject to the external-contributor proof gate.
Evidence reviewed 7 items Route classification: The shared predicate treats only a defined, non-WebChat resolved route as external, so a no-route dashboard session is not mistaken for an outbound delivery requirement.
Completion owner: Current-session completion commits to the captured conversation before branching between local completion, external delivery, and a preserved unavailable-route error.
Delivery outcome propagation: Dispatch records a delivery error as not-delivered rather than reporting it as delivered, while finalization keeps payload execution separate from completion delivery state.
Findings None None.
Security None None.

How this fits together

Cron agent turns commit their result to the conversation that created them, then optionally deliver it to an external channel. Completion state distinguishes local conversation completion, successful external delivery, and an unresolved external route.

flowchart LR
  A[Scheduled cron job] --> B[Current-session agent run]
  B --> C[Conversation transcript commit]
  C --> D{External route resolved?}
  D -->|No route or WebChat| E[Local completion recorded]
  D -->|Available route| F[External delivery]
  D -->|Unavailable named route| G[Delivery failure recorded]
Loading

Before merge

  • Resolve merge risk (P1) - The supplied real gateway run predates the final rebase; focused tests cover the final route decisions, but this offline read-only review could not independently obtain exact-head live confirmation.
  • Resolve merge risk (P1) - The supplied PR state still has required checks in progress, so exact-head CI must finish successfully before landing.
Agent review details

Security

None.

PR surface

Source +42, Tests +113, Docs +2. Total +157 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 50 8 +42
Tests 2 114 1 +113
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 166 9 +157

Review metrics

Metric Value Why it matters
Production vs test LOC production +50/-8, docs +2/-0, tests +114/-1 The production growth centralizes route classification and propagates unavailable-route state; focused tests cover both new delivery branches.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused route-classification repair after maintainer review and exact-head CI, retaining the resolver predicate as the sole runtime and preview classification path.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the focused route-classification repair after maintainer review and exact-head CI, retaining the resolver predicate as the sole runtime and preview classification path.

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

Yes for the source-defined branch: a current-session dashboard job with default announce delivery and no configured external channel resolves without a route after its transcript commit. The supplied live run exercised that scenario before rebasing; this read-only checkout did not execute it.

Is this the best way to solve the issue?

Yes. Classifying the resolver’s recorded route once and reusing it in completion and preview removes the brittle session-key check while preserving the external-delivery distinction from the merged delivery-outcome work.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The patch repairs a default current-session automation path that can otherwise hide a completed dashboard result behind a failed delivery outcome.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied gateway run exercised a dashboard-bound current-session automation with no external route and observed transcript commit, successful status, and cleanup on a pre-rebase fix head. The final head’s unavailable-route preservation is covered by focused tests; this member-authored PR is not subject to the external-contributor proof gate.

Evidence

What I checked:

Likely related people:

  • jalehman: Introduced the merged current-session delivery pathway and authored the reviewed route-classification repair. (role: recent current-session delivery contributor; confidence: high; commits: 133d5fff6c94, c0c2f7e15b66, 4f1eaee0234a; files: src/cron/isolated-agent/current-session-completion.ts, src/cron/isolated-agent/delivery-target.ts)
  • steipete: Merged fix(cron): record real delivery outcomes and stop false-success completions #131228, which established the execution-versus-delivery outcome semantics consumed by this patch. (role: recent cron delivery-outcome contributor; confidence: high; commits: 13125bf33f20; files: src/cron/isolated-agent/run-finalize.ts, src/cron/completion-status.ts)
  • hermanzeng: Recent lifecycle work in the same current-session cron neighborhood is relevant to follow-up ownership. (role: recent current-session lifecycle contributor; confidence: medium; commits: 5b072470f191; files: src/cron/isolated-agent/current-session-completion.ts)

Rank-up moves

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

  • Confirm the focused checks and required CI on the exact head before landing.

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-08-28T17:45:20.940Z sha 3f98ec98b618cef4b5bccaae92971a8a1dfb37f1 :: needs real behavior proof before merge. :: [P1] Preserve failed external-plugin delivery routes
  • reviewed 2026-08-28T18:11:55.452Z sha 6997a0c :: needs changes before merge. :: [P1] Preserve unavailable external plugin routes
  • reviewed 2026-08-28T21:24:17.592Z sha 204ad2c :: needs maintainer review before merge. :: none

@jalehman
jalehman force-pushed the openclaw/fix-automation-announce-failing-on-webchat-only-gateways branch from 3f98ec9 to 6997a0c Compare August 28, 2026 18:01
@jalehman
jalehman marked this pull request as ready for review August 28, 2026 18:02
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. 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. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 28, 2026
jalehman and others added 2 commits August 28, 2026 14:59
…annel route

A sessionTarget=current agentTurn automation on a webchat-only gateway
failed its whole run with 'Channel is required (no configured channels
detected)' even though the completion had already committed durably to
the target conversation. The current-session completion decided whether
an external announce was still owed by string-matching 'webchat' against
the session-key prefix, which misses Control UI dashboard sessions
(agent:<id>:dashboard:<uuid>), and the resulting delivery-target error
was exempt from the #94058 turn-success preservation — a silent failure
on the default path.

Decide external-delivery necessity from the resolution's recorded route
instead: a failed resolution that names no deliverable external channel
has nothing external backing the conversation, so the committed
completion is the delivery and the run succeeds. A failed resolution
that does name an external channel keeps the run successful and records
the failure as the run's delivery error, distinguishing 'turn succeeded,
delivery failed' from 'turn failed'. The delivery preview mirrors the
same rule instead of showing 'will fail-closed' for these jobs.

Live-verified on an isolated no-channel gateway built from this branch:
a one-shot current-target automation bound to a dashboard session ran,
committed its result to the conversation transcript, persisted
status=succeeded, and auto-deleted.

Co-Authored-By: Claude Fable 5 <[email protected]>
@jalehman
jalehman force-pushed the openclaw/fix-automation-announce-failing-on-webchat-only-gateways branch from 204ad2c to 4f1eaee Compare August 28, 2026 22:02
@jalehman
jalehman merged commit 4160df0 into main Aug 28, 2026
233 checks passed
@jalehman
jalehman deleted the openclaw/fix-automation-announce-failing-on-webchat-only-gateways branch August 28, 2026 22:19
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 29, 2026
…" on webchat-only gateways (openclaw#131975)

* fix(cron): complete current-target automations without an external channel route

A sessionTarget=current agentTurn automation on a webchat-only gateway
failed its whole run with 'Channel is required (no configured channels
detected)' even though the completion had already committed durably to
the target conversation. The current-session completion decided whether
an external announce was still owed by string-matching 'webchat' against
the session-key prefix, which misses Control UI dashboard sessions
(agent:<id>:dashboard:<uuid>), and the resulting delivery-target error
was exempt from the openclaw#94058 turn-success preservation — a silent failure
on the default path.

Decide external-delivery necessity from the resolution's recorded route
instead: a failed resolution that names no deliverable external channel
has nothing external backing the conversation, so the committed
completion is the delivery and the run succeeds. A failed resolution
that does name an external channel keeps the run successful and records
the failure as the run's delivery error, distinguishing 'turn succeeded,
delivery failed' from 'turn failed'. The delivery preview mirrors the
same rule instead of showing 'will fail-closed' for these jobs.

Live-verified on an isolated no-channel gateway built from this branch:
a one-shot current-target automation bound to a dashboard session ran,
committed its result to the conversation transcript, persisted
status=succeeded, and auto-deleted.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(cron): preserve unavailable external delivery routes

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant