Repository navigation
fix(channels): preserve failed agent run reactions - #122009
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
1f52e7b to
e475194
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 6:07 PM ET / 22:07 UTC. ClawSweeper reviewWhat this changesThe PR records recovered agent-run failure semantics in shared dispatch and lets Telegram, Discord, Slack, Signal, and WhatsApp render an error terminal status after successfully delivering the visible recovery message. Merge readinessThis active maintainer PR is still necessary: current main lacks the core-owned terminal outcome that lets five channels distinguish a recovered failed run from successful transport delivery. The narrow SDK reader, core lifecycle ownership, and channel projections are coherent; no blocking patch defect was found. Priority: P1 Review scores
Verification
How this fits togetherInbound channel messages enter shared reply dispatch, which owns agent execution and returns delivery facts. Channel plugins then map that result to native reactions or progress UI without treating transport success as agent-run success. flowchart LR
A[Inbound channel message] --> B[Shared reply dispatch]
B --> C[Agent run starts]
C --> D[Recovered visible error]
D --> E[Dispatch result semantic]
E --> F[Channel status projection]
F --> G[Error reaction or progress state]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +55, Tests +242, Docs +8, Generated 0, Other +2. Total +307 across 26 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the accepted narrow reader and core-owned terminal semantic, with channel plugins remaining thin projections of that fact and delivery success remaining transport-only. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: a started run can emit a visible partial and then throw into the existing recovery payload path, where the base result carried delivery facts but no terminal run semantic. Is this the best way to solve the issue? Yes—the semantic belongs in shared dispatch, which owns agent-run lifecycle, rather than duplicating failure inference in each channel; the channel changes only project the authoritative fact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 459c70e14a2c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
06b79a3 to
e92801e
Compare
Mantis Telegram Live QASummary: Mantis ran the Telegram live QA lane with Convex-leased credentials, rendered a redacted transcript in a Crabbox desktop browser, and captured screenshot/video evidence for PR review.
Telegram live transcript Telegram motion preview Motion-trimmed clips: Full videos: |
Exact-head land-ready evidenceThe evidence package for Root cause and owner boundary: shared reply dispatch can recover a started agent run's visible partial into a successfully delivered error payload. Delivery success is a transport fact, but Telegram, Discord, Slack, Signal, and WhatsApp also need the core-owned run semantic to select their terminal reaction/status. Inferring that fact in each channel would duplicate policy in the wrong layer. Canonical repair:
SDK decision and closure proof:
Proof:
Telegram proof boundary:
Evidence corrections remain explicit:
LOC: production +103/-54 (net +49); tests/support +253/-5; tooling +4/-2; docs +8/-0; generated baseline +1/-1. The carrier accounts for the intentional growth that removes broad public-result closure coupling. No config, protocol, storage, dependency, changelog, release, issue-close, or task #45 change. Native merge was not run. |
|
Superseded by the exact-head maintainer API decision for The earlier direct-field approval is withdrawn. The accepted public contract is the narrow |
8d67508 to
ad9b2a2
Compare
ad9b2a2 to
48bf634
Compare
e9876ac to
9497498
Compare
fd405bc to
d389ba2
Compare
|
Maintainer API decision for I approve the narrow Core owns an enumerable process-local The production net +49 is accepted because the 22-line carrier and narrow facade eliminate 112 existing closure-hash changes across 22/152 modules: the exact-main SDK comparison adds only the reader and type in one module, with zero existing declaration or closure changes. Telegram, Discord, Slack, Signal, and WhatsApp keep transport success independent from terminal run semantics; Slack native progress and terminal reactions agree. The direct changed gate, full build/import checks, all 152 SDK subpaths, docs gate, focused channel/core tests, and fresh autoreview are green. Exact-head PR CI is green at https://github.com/openclaw/openclaw/actions/runs/31537364158. Historical cancelled runs remain cancelled and are not used as green evidence. Mantis remains valid proof of in-place Telegram recovery/no duplicate, while the bot-authored reaction itself remains deterministic-only proof for the documented Bot API reason. Fresh exact-head ClawSweeper review is published at #122009 (comment) with no findings, no security concerns, and no rank-up moves. Main advanced again after CI attached and GitHub now reports a newer generated-SDK/tooling conflict; this run intentionally stops before merge. |
d389ba2 to
c6c22c9
Compare
c6c22c9 to
fd0e3fe
Compare
|
Merged via squash.
|
* origin/main: (1725 commits) fix(agents): preserve reply cleanup when cancellation throws (#122252) fix(ui): render disallowed link schemes as plain text (#122311) fix(test): isolate gateway helper env stubs (#122319) fix(ui): keep chat Markdown block rhythm consistent (#122289) test(cli): trim duplicate Hooks process cases (#122278) fix(ui): retain identity while agent roster loads fix(ui): preserve configured agent labels fix(plugins): keep startup convergence read-only (#122330) fix: preserve WebChat reply context after reloads (#122169) fix(ui): make DONE moves visibly reversible (#122303) fix(ui): keep inline-code punctuation attached (#122291) fix(google-meet): publish exports atomically (#122306) fix(channels): preserve failed agent run reactions (#122009) fix(ui): label patch file operations accurately (#122287) fix(windows): preserve Unicode LAN route aliases (#122263) test(media): synchronize transcode pool completion (#122279) fix(android): keep completed subagent activity visible for sixty seconds (#122089) fix(ui): humanize bare GitHub item links (#122285) refactor(qqbot): install plugin from Tencent package (#107295) chore: scope SQLite session lifecycle CI (#121917) ...


What Problem This Solves
Fixes an issue where a recovered agent-run failure could deliver a visible error payload successfully but still leave Telegram, Discord, Slack, Signal, or WhatsApp showing a completed reaction/status. Delivery success and run semantics were being treated as the same fact.
Why This Change Was Made
Core now records the terminal semantic on the actual dispatch result through an enumerable, process-local symbol carrier. Plugin consumers read it with
readAgentRunTerminalOutcome(...)fromopenclaw/plugin-sdk/channel-inbound;DispatchFromConfigResultitself is unchanged.The carrier records
"completed"only after the authoritativeonAgentRunStartcallback. It changes to"failed"only in the existing recovered-visible failure catch after a started run has already delivered a visible partial. Raw throws remain channel-owned errors. Command, dedupe, busy, pre-run abort, and custom-dispatch plain-object paths have no carrier and the reader returnsundefined.The symbol is an enumerable own property so the existing dispatch and non-visible-delivery object spreads preserve it. JSON serialization ignores symbol keys, so this adds no protocol or JSON shape. The internal setter and symbol remain private; only the reader and closed outcome type are exported through the existing channel-inbound facade.
Telegram, Discord, Slack, Signal, and WhatsApp use the reader for terminal reactions/status. Slack native progress cards also finish as error. Successful delivery of the recovered error payload remains transport success, including the delivered-message hook.
User Impact
After a started agent run visibly recovers from failure, the five affected channels now show an error terminal state instead of a misleading completed state. Normal success, delivery failure, silent, command, dedupe, busy, abort, custom dispatch, and raw-throw behavior is unchanged.
Evidence
fd0e3fedf8c3214e209dc4c1b8c1cb62e3a8002c; exact rebased main parent:84c7d45f15cd2ba093797ac1c4c9fd198a7cf6e3.docs/.generated/plugin-sdk-api-baseline/channel-inbound.jsonandscripts/plugin-sdk-surface-report.mts. The baseline was regenerated withpnpm plugin-sdk:api:gen; current-main surface budgets were advanced by exactly two exports and one callable, to4873and2926, while preserving current-main ratchets and comments.c6c22c9f073c21a3ed4cd9ebd7276ad0be48e987and finalfd0e3fedf8c3214e209dc4c1b8c1cb62e3a8002ccommits have the same stable patch id,46d07da97d4ac817510274c1f64a309e1723d2dc; the filtered one-commit range-diff is=. No product, core, or channel patch changed in the rebase.readAgentRunTerminalOutcomeandAgentRunTerminalOutcome) inchannel-inbound; zero existing declarations or closure hashes change, and onlychannel-inbound.jsonchanges.undefined.error; every channel keeps visible error delivery successful while selecting error status.string-coerce-runtimemock omitsasOptionalRecord; the changed Slack case passes and this PR does not modify task clawdis send command fails for WhatsApp group JIDs #45.tbx_01kzs8139s7tfbvba3a6krpf45(run https://github.com/openclaw/openclaw/actions/runs/31532871703) completed the final changed gate, full build, all 152 public Plugin SDK subpath checks, zero import cycles, and the full docs gate with terminal exit 0, then was stopped.pnpm plugin-sdk:api:check,pnpm plugin-sdk:surface:check,pnpm plugin-sdk:check-exports, the Plugin SDK subpath-export check,git diff --check, 7 carrier tests, and 2 core terminal-recovery tests.c6c22c9f073c21a3ed4cd9ebd7276ad0be48e987with no failed jobs. Final-head CI https://github.com/openclaw/openclaw/actions/runs/31541606179 then completed successfully onfd0e3fedf8c3214e209dc4c1b8c1cb62e3a8002c; native prepare accepted the exact-head run.Hosted evidence truth
Current merge status
READY FOR /prepare-pr, exact-head hosted prepare passed, and native merge completed atb350f76484ad228fcb711ebb769eb2f60d4657feon 2026-08-11T22:26:45Z.main, and clean persistentmainall confirm the landed commit.Telegram live/mock proof boundary
Protected Mantis run https://github.com/openclaw/openclaw/actions/runs/31488547825 passed
telegram-partial-failure-recovery: a real Telegram visible partial was edited in place into one recovery message and no replacement fallback was sent. Public evidence: #122009 (comment). Artifact: https://github.com/openclaw/openclaw/actions/runs/31488547825/artifacts/9100873059.The bot-to-bot QA adapter cannot observe the bot-authored ❌ reaction: Telegram states that
message_reactionupdates are not received for reactions set by bots (https://core.telegram.org/bots/api#update). The deterministic Telegram controller regression provessetError, ordering, successfulmessage_sent, and nosetDone; the protected live run proves in-place recovery and no duplicate. This is intentionally not described as full live reaction proof.No config, protocol, storage, dependency, changelog, release, issue-close, or task #45 change.