Repository navigation
fix(cron): current-session automations fail with "Channel is required" on webchat-only gateways - #131975
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 6:10 PM ET / 22:10 UTC. ClawSweeper reviewWhat this changesThe PR fixes current-session cron automations on no-channel WebChat/Control UI gateways and preserves unavailable external routes as recorded delivery failures. Merge readinessThe 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 Review scores
Verification
How this fits togetherCron 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +42, Tests +113, Docs +2. Total +157 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
3f98ec9 to
6997a0c
Compare
…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]>
204ad2c to
4f1eaee
Compare
…" 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]>
What Problem This Solves
Fixes an issue where a scheduled automation (agentTurn, sessionTarget
current, default delivery modeannounce) 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
webchatagainst 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
src/cron/delivery-preview.test.tsandsrc/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 head6997a0cc675(168 tests).check:changedpasses on the rebased 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, persistedlastRunStatus=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.delivery-dispatch.double-announce.test.ts): the turn staysokwith 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.