Repository navigation
fix: restore message actions for CLI channel replies - #149131
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 11:33 PM ET / September 16, 2026, 03:33 UTC (Revision 4). ClawSweeper reviewWhat this changesRestores permitted message reads and actions for CLI-backed channel replies by carrying private, turn-bound conversation authority through the Gateway’s MCP bridge. Merge readiness✅ Ready for maintainer review This remains a useful repair absent from current main. The earlier cancellation concern is addressed by the integrated caller-lifetime safeguards and recorded boundary proof; no actionable patch defect remains. The related scheduled-turn permission request is a separate concern. Priority: P1 Review scores
Verification
How this fits togetherCLI-backed agents call OpenClaw tools through the Gateway’s MCP bridge. The bridge binds those calls to the admitted channel conversation before the message tool applies account, sender, and provider permissions. flowchart TD
A[Incoming channel message] --> B[Admitted reply turn]
B --> C[Candidate-scoped authority]
C --> D[Private Gateway grant]
E[CLI tool request] --> D
D --> F[Message permission and liveness checks]
F --> G[Provider read or action]
B --> H[Completion or cancellation revokes access]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +52, Tests +992, Docs +6. Total +1050 across 19 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Use the existing host-owned turn authority for both execution backends while preserving provider permissions, candidate revocation, and accepted-send settlement. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: current main’s CLI grant omits the authority required by the message tool, matching the reporter’s Discord reaction trace. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Yes. The patch repairs the existing authority handoff without trusting child-supplied routing fields, widening plugin delivery permissions, or adding a competing authorization mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 24387d03fd3e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
19677bc to
3251399
Compare
|
Fixed: CLI-backed channel replies can use permitted message reads and actions through the Gateway MCP bridge. |
Restore permitted message reads and actions for CLI-backed channel replies through the Gateway MCP bridge. Refs openclaw#139119.
…lity The scheduled grant is redeemed under the turn's runtime policy key; personal-tool authority checks the run's own registration through sourceReplySessionKey, as ordinary replies already set it (openclaw#149131).
…n session is used from a DM (#180603) fix(cron): bind scheduled message capabilities under the keys the run's tools use Since scheduled conversation work moved through session admission (#178764), a cron or heartbeat run on the main session minted its message-action capability under the plain session key, while the run's own tools looked it up under the peer-scoped runtime policy key when the main session was used from a DM. The lookup missed, so every message send failed with "message action turn capability is no longer active", or the run failed earlier with "plugin delivery capability is no longer active". The scheduled grant is now redeemable under the turn's runtime policy key and records the execution session key as sourceReplySessionKey, as ordinary replies already do (#149131). It is still one capability for the same run with the same lifetime and revocation; nothing is granted, widened or skipped. No text changes. Evidence: a built Gateway with the real bundled Codex app-server against a local model endpoint that calls message, the real WhatsApp channel with only the Baileys socket stood in, and a Telegram stand-in, two runs each. With the main session used from a WhatsApp DM, a heartbeat on agent:main:main failed the send on main and delivers with this change; from a Telegram DM it failed before the model call on main and delivers with this change. Ordinary DM turns, an isolated job and an announce job with --to deliver on both, a heartbeat whose job is removed mid-decision sends nothing, and a grant minted for one peer is refused for another peer on both. Net 0 test lines; the structured-result test fails on main. Details: #180603 (comment). Closes #180602. Closes #197181. Thanks @masatohoshino for the fix and @Suiah98 for the report. Co-authored-by: Ayaan Zaidi <[email protected]>
…n session is used from a DM (openclaw#180603) fix(cron): bind scheduled message capabilities under the keys the run's tools use Since scheduled conversation work moved through session admission (openclaw#178764), a cron or heartbeat run on the main session minted its message-action capability under the plain session key, while the run's own tools looked it up under the peer-scoped runtime policy key when the main session was used from a DM. The lookup missed, so every message send failed with "message action turn capability is no longer active", or the run failed earlier with "plugin delivery capability is no longer active". The scheduled grant is now redeemable under the turn's runtime policy key and records the execution session key as sourceReplySessionKey, as ordinary replies already do (openclaw#149131). It is still one capability for the same run with the same lifetime and revocation; nothing is granted, widened or skipped. No text changes. Evidence: a built Gateway with the real bundled Codex app-server against a local model endpoint that calls message, the real WhatsApp channel with only the Baileys socket stood in, and a Telegram stand-in, two runs each. With the main session used from a WhatsApp DM, a heartbeat on agent:main:main failed the send on main and delivers with this change; from a Telegram DM it failed before the model call on main and delivers with this change. Ordinary DM turns, an isolated job and an announce job with --to deliver on both, a heartbeat whose job is removed mid-decision sends nothing, and a grant minted for one peer is refused for another peer on both. Net 0 test lines; the structured-result test fails on main. Details: openclaw#180603 (comment). Closes openclaw#180602. Closes openclaw#197181. Thanks @masatohoshino for the fix and @Suiah98 for the report. Co-authored-by: Ayaan Zaidi <[email protected]>
…n session is used from a DM (#180603) fix(cron): bind scheduled message capabilities under the keys the run's tools use Since scheduled conversation work moved through session admission (#178764), a cron or heartbeat run on the main session minted its message-action capability under the plain session key, while the run's own tools looked it up under the peer-scoped runtime policy key when the main session was used from a DM. The lookup missed, so every message send failed with "message action turn capability is no longer active", or the run failed earlier with "plugin delivery capability is no longer active". The scheduled grant is now redeemable under the turn's runtime policy key and records the execution session key as sourceReplySessionKey, as ordinary replies already do (#149131). It is still one capability for the same run with the same lifetime and revocation; nothing is granted, widened or skipped. No text changes. Evidence: a built Gateway with the real bundled Codex app-server against a local model endpoint that calls message, the real WhatsApp channel with only the Baileys socket stood in, and a Telegram stand-in, two runs each. With the main session used from a WhatsApp DM, a heartbeat on agent:main:main failed the send on main and delivers with this change; from a Telegram DM it failed before the model call on main and delivers with this change. Ordinary DM turns, an isolated job and an announce job with --to deliver on both, a heartbeat whose job is removed mid-decision sends nothing, and a grant minted for one peer is refused for another peer on both. Net 0 test lines; the structured-result test fails on main. Details: #180603 (comment). Closes #180602. Closes #197181. Thanks @masatohoshino for the fix and @Suiah98 for the report. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 4f96534) Co-authored-by: RomneyDa <[email protected]>
Related: #139119.
What Problem This Solves
Channel replies using a CLI backend could send messages but could not perform otherwise permitted reads or reactions through OpenClaw's
messagetool. The Gateway MCP grant was missing the host's conversation authority.User Impact
CLI-backed channel replies using the Gateway MCP bridge can perform permitted Discord reactions, pins, deletions and channel edits, and Discord/Slack reads. The tool retains the admitted sender, account, conversation and provider permissions.
Why This Change Was Made
The shared fallback-candidate owner supplies the existing message authority to CLI and embedded execution, with a separate token for each candidate and revocation before the next candidate starts. CLI grants carry the token privately to the message tool and preserve the durable reply session when policy uses a separate session key. Plugin delivery keeps its existing permissions.
Evidence