Skip to content

fix(approvals): let OpenClaw change approvals complete in chat - #157947

Merged
obviyus merged 6 commits into
mainfrom
feat/chat-native-approvals
Sep 25, 2026
Merged

obviyus merged 6 commits into
mainfrom
feat/chat-native-approvals

Conversation

@obviyus

@obviyus obviyus commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: when an agent asks OpenClaw to change config, restart, or manage plugins/channels/agents, the approval never reaches chats without a native approval card, and /approve <id> rejects it. The agent's tool call then blocks until the 10-minute expiry, and users are sent to the Control UI or a terminal to approve a change they asked for in chat.

User Impact

User impact: every approval an agent needs can be completed in the chat where it was requested.

  • Native approval cards (Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Teams, iMessage, Google Chat) keep owning their chats.
  • Every other requesting chat now gets the change summary with Allow once / Deny buttons where the channel renders them, plus a /approve <id> allow-once|deny line.
  • /approve now resolves OpenClaw change approvals, not only exec and plugin approvals.

No config options, protocol, or schema changes.

Why This Change Was Made

Delegated OpenClaw changes ("system-agent" approvals) already had native cards (#134670). Two gaps remained outside those cards:

  • Request delivery. The request was created with delivery turned off, so the shared approval forwarder never posted a fallback. The forwarder now has a system-agent strategy that always targets the requesting chat and is suppressed whenever that chat's native card handles the request. It uses the same typed-button payload and resolved/expired messages as exec and plugin approvals. The system-agent owner publishes the outcome of a decision (applied, or denied) once; approval publication only adds expiry and cancellation, so a denial produces one chat update. The fallback answers only the live messaging chat that made the request: terminal and Webchat requests never fall back to the session's saved chat, and expiry is reported once, from the Gateway's recorded expiry rather than a local chat timer, so a change approved just before the deadline and applied after it reports its applied outcome instead of a false expiry.
  • /approve. The command probed only exec and plugin approvals. It now also resolves system-agent approvals through the canonical approval.resolve, after confirming the id is in openclaw.approval.list. Canonical resolution records a kind mismatch as a deny, so /approve confirms the owner first instead of probing. On channels with their own approver settings (Telegram, Discord, Slack, …), the Gateway checks the sender as the reviewer, the same check as native buttons. Everywhere else only a configured owner (commands.ownerAllowFrom) can approve an OpenClaw change: /approve sends the sender as the reviewer, and the Gateway checks owner custody against the current config inside the approval store's final decision guard. An ordinary command-authorized sender is refused, and an owner removed after sending /approve cannot complete the decision.

Unchanged: approval authority stays bound to the requesting run; free-text "yes" never approves; Full Access still auto-applies; Control UI and the apps can still decide.

Agent-facing text now says what happens: for runs from messaging channels, the openclaw tool description says the change waits for approval in this chat (buttons or /approve). Webchat and terminal runs, which the chat fallback cannot reach, are told to approve in the Control UI or OpenClaw apps. The gateway-only prompt line points to openclaw and /restart instead of "ask human".

Evidence

Real Telegram (Test Server userbot, Convex-leased credentials, fresh Gateway, mock provider), restricted exec mode, agent asks OpenClaw to set logging.level "info":

Run Setup What the user saw Tap Result
A tester is owner (native cards on) 🔒 native approval card, no /approve text Allow Once answerCallbackQuery + 2× editMessageText: "approved. Applying" → "approved and applied"; final reply delivered
C tester is owner, channels.telegram.execApprovals.enabled: false fallback message with change summary, /approve <id> allow-once|deny, and Allow Once button Allow Once message edited to "approved. Applying…", then "approved and applied" posted; Gateway config on disk has logging.level: "info"; final reply delivered

Telegram Web screenshots from the same leased test account (cropped to the conversation):

Pending After Allow Once
Native card (A) Native Telegram approval card with Allow Once and Deny buttons Native card edited to approved and applied, followed by the final reply
Fallback message (C) Fallback approval message with change summary, /approve line, and Allow Once and Deny buttons Fallback message resolved: approved and applying, then approved and applied, then the final reply

With no owner configured, the owner-only openclaw tool isn't exposed, so no change is proposed (config unchanged). That's the existing design; DM pairing sets the first owner.

qa-channel (no native approval cards), new scenario system-agent-chat-approval: the agent's delegated change posts the approval in the requesting conversation. A command-authorized non-owner (commands.allowFrom includes them, ownerAllowFrom does not) sends /approve <id> allow-once and gets "❌ Only the owner can approve OpenClaw changes in this chat."; logging.level is unchanged and the approval stays pending. The owner's /approve <id> allow-once then resolves it; logging.level becomes info; exactly one final reply. On origin/main the same scenario times out waiting for the approval in the chat.

Tests: /approve (resolves a pending OpenClaw change canonically; never submits a canonical decision for an id owned by another kind; on a channel without approver settings, a non-owner and a revoked owner never reach the canonical decision), channel custody (without approver settings only a configured owner holds custody, and only for OpenClaw changes), approval.resolve (custody revoked between the request and the final write leaves the approval pending), approval publication (allowed/denied changes leave the chat outcome to the system-agent owner; expired/cancelled are published once), forwarder (requesting chat gets the prompt and outcome without approvals.* config; a running native card suppresses it; terminal and Webchat requests never reach the saved session chat; a change applied after the deadline reports its outcome with no false expiry; the recorded expiry is reported once), plus existing gateway approval and system-agent suites. The new owner-custody and single-publisher tests fail with the fix reverted. Shared approval and forwarder fixtures moved to sibling *.test-support.ts modules so the test files stay under the line cap. Wall time for the touched suites: commands-approve + approval-publication + exec-approval-forwarder + system-agent-approval + approval ran in 59.5s across 3 Vitest shards. pnpm tsgo:core clean.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling extensions: qa-lab size: L labels Sep 25, 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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 4:41 AM ET / 08:41 UTC (Revision 6).

ClawSweeper review

What this changes

The branch sends delegated OpenClaw change approvals to the requesting chat when no native card handles them and lets /approve submit a decision through the Gateway.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still leaves these chat approvals without a fallback, while this PR addresses the gap. The latest revision also resolves the earlier near-deadline expiry finding.

Priority: P1
Reviewed head: 2d42ca43d2f5e6017ffe3c90e7bf54e7f2758161

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Real Telegram evidence and focused authority and expiry coverage support a coherent repair across the approval path.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The changed Gateway forwarder and approval owner are exercised through Telegram Test Server chat screenshots showing the pending prompt, approved-and-applied outcome, and final reply; the reported qa-channel run covers non-owner denial and owner application. The diff changes no stored-data contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The changed Gateway forwarder and approval owner are exercised through Telegram Test Server chat screenshots showing the pending prompt, approved-and-applied outcome, and final reply; the reported qa-channel run covers non-owner denial and owner application. The diff changes no stored-data contract.
Evidence reviewed 7 items Current main gap: Current main explicitly disables fallback delivery for delegated change approvals; its /approve command routes only exec and plugin approvals.
Introduced delivery path: The branch calls the shared forwarder for a pending delegated change; the forwarder requires a live messaging origin and suppresses fallback when an active native route owns the target.
Final authority check: The canonical resolution path prepares channel custody again from current config inside the decision guard used by the approval-store write.
Findings None None.
Security None None.

How this fits together

An agent’s proposed config or service change enters the Gateway approval manager. The Gateway delivers a decision request to an approval surface, checks the reviewer’s current authority, then applies the change and reports its outcome.

flowchart LR
A[Agent change request] --> B[Gateway approval]
B --> C{Native card available?}
C -->|Yes| D[Native chat card]
C -->|No| E[Requesting chat fallback]
D --> F[Approval decision]
E --> F
F --> G[Live reviewer check]
G --> H[Change and chat outcome]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +279, Tests +479, Docs +9, Other +152. Total +919 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 16 368 89 +279
Tests 10 1035 556 +479
Docs 3 16 7 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 1 152 0 +152
Total 30 1571 652 +919

Review metrics

Metric Value Why it matters
Production and proof delta production +368/−89; tests and QA +1187/−556 The production growth extends the existing approval route; much of the test delta moves shared fixtures while adding boundary coverage.

Technical review

Best possible solution:

Keep native cards and the requesting-chat fallback under the existing Gateway approval owner, with current reviewer custody checked before the change is applied and one accurate terminal chat outcome.

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

Yes. Current main explicitly disables fallback delivery and routes /approve only to exec or plugin approvals; the PR body reports that its qa-channel scenario times out on main.

Is this the best way to solve the issue?

Yes. The branch extends the existing approval forwarder and canonical resolver, with reviewer authority rechecked at the final decision boundary.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦐 gold shrimp.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: A delegated change requested in chat can otherwise wait until expiry without an in-chat decision path.
  • merge-risk: 🚨 message-delivery: The new fallback sends approval prompts and outcomes to a chat, making requesting-conversation targeting important.
  • merge-risk: 🚨 security-boundary: The new chat command can authorize persistent OpenClaw changes; the Gateway’s current-custody guard protects that boundary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The changed Gateway forwarder and approval owner are exercised through Telegram Test Server chat screenshots showing the pending prompt, approved-and-applied outcome, and final reply; the reported qa-channel run covers non-owner denial and owner application. The diff changes no stored-data contract.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Gateway forwarder and approval owner are exercised through Telegram Test Server chat screenshots showing the pending prompt, approved-and-applied outcome, and final reply; the reported qa-channel run covers non-owner denial and owner application. The diff changes no stored-data contract.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The changed Gateway forwarder and approval owner are exercised through Telegram Test Server chat screenshots showing the pending prompt, approved-and-applied outcome, and final reply; the reported qa-channel run covers non-owner denial and owner application. The diff changes no stored-data contract.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The PR changes approval prompts, buttons, and outcome messages visible in Telegram chat.

Evidence

What I checked:

  • Current main gap: Current main explicitly disables fallback delivery for delegated change approvals; its /approve command routes only exec and plugin approvals. (src/gateway/server-methods/system-agent-approval.ts:334, fc2a1108416b)
  • Introduced delivery path: The branch calls the shared forwarder for a pending delegated change; the forwarder requires a live messaging origin and suppresses fallback when an active native route owns the target. (src/infra/exec-approval-forwarder.ts:381, 2d42ca43d2f5)
  • Final authority check: The canonical resolution path prepares channel custody again from current config inside the decision guard used by the approval-store write. (src/gateway/server-methods/approval.ts:383, 2d42ca43d2f5)
  • Expiry finding resolved: The system-agent strategy has no local expiry timer. Its focused test advances beyond the deadline, then checks that an accepted and applied change produces an applied notice without a false expiry. (src/infra/exec-approval-forwarder.test.ts:616, 2d42ca43d2f5)
  • Real chat proof: The supplied Telegram Test Server screenshots show a native card and a fallback prompt, followed by the approved-and-applied message and final reply. The PR body also reports a qa-channel run in which a non-owner was denied and the owner applied the config change.
  • Merged feature context: The earlier merged change added native channel delivery for delegated approvals; this PR addresses the remaining fallback and slash-command path. (src/gateway/approval-channel-custody.ts:24, cd358597cf49)

Likely related people:

  • Ayaan Zaidi: Raw commit 9935ca3 adds src/gateway/approval-channel-custody.ts:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9935ca3b30dc; files: src/gateway/approval-channel-custody.ts)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Eden: 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 (5 earlier review cycles)
  • reviewed 2026-09-25T06:01:02.965Z sha 3faa19089a21261d57c97b0969cb7cb25ee3a8d5 :: needs real behavior proof before merge. :: [P1] Require owner or reviewer custody for change approvals | [P2] Publish one terminal update for a denied change
  • reviewed 2026-09-25T06:54:48.780Z sha c9321080336e73603fa0969c0dab8ccfbc75f4e4 :: needs real behavior proof before merge. :: [P1] Recheck chat-owner authority at the final approval decision
  • reviewed 2026-09-25T07:25:32.827Z sha 0e66040d65db8a9b49f750a6005fa03470d80d35 :: needs changes before merge. :: [P2] Scope the in-chat approval promise to supported channels
  • reviewed 2026-09-25T07:49:58.665Z sha f1ecfc9 :: blocked before merge. :: [P1] Require a live chat origin before forwarding a change approval | [P2] Publish each change-approval expiry once
  • reviewed 2026-09-25T08:14:31.560Z sha fd9214f :: blocked before merge. :: [P2] Keep an accepted change from expiring in chat

@obviyus
obviyus marked this pull request as ready for review September 25, 2026 06:45
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 2d42ca43d2f5e6017ffe3c90e7bf54e7f2758161
  • Maintainer: @obviyus
  • Repository role: maintain

These security sensitive changes were made:

  • src/infra/exec-approval-forwarder.messages.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/exec-approval-forwarder.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 25, 2026
Deliver delegated OpenClaw change approvals to the requesting chat through the shared approval forwarder when no native card owns it, and let /approve resolve them canonically after confirming the pending owner. Update the openclaw tool and gateway prompt copy to point at in-chat approval.
@obviyus
obviyus force-pushed the feat/chat-native-approvals branch from 0e66040 to f1ecfc9 Compare September 25, 2026 07:41
@clawsweeper clawsweeper Bot removed the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Sep 25, 2026
@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Sep 25, 2026
@obviyus
obviyus merged commit a71e556 into main Sep 25, 2026
398 of 402 checks passed
@obviyus
obviyus deleted the feat/chat-native-approvals branch September 25, 2026 09:36
@obviyus

obviyus commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in a71e556.

Bug: an OpenClaw change requested from chat (config, restart, plugins, channels, agents) only reached chats with a native approval card. Everywhere else the agent's tool call waited until the 10-minute expiry, and /approve <id> rejected the approval.

Fix:

  • The requesting messaging chat gets the change summary with Allow once / Deny buttons, or a /approve line where the channel has no buttons. Native cards still own their chats.
  • /approve resolves OpenClaw change approvals. On channels without their own approver settings, only a configured owner can approve, and the Gateway rechecks that at the final approval decision.
  • Webchat and terminal runs are pointed to the Control UI or the apps. The fallback never answers a saved or earlier chat, and the Gateway reports expiry once.

Proof:

  • Telegram Test Server screenshots in the PR body show both the native card and the fallback, pending and applied.
  • The qa-channel scenario system-agent-chat-approval: a non-owner is refused with the config unchanged, then the owner approves, the change applies, and exactly one final reply is sent. On main before this change, the same scenario timed out.
  • Regression tests cover owner custody, owner revocation at the final decision, a single final chat update, live-origin-only routing, and a change applied after its deadline.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
…law#157947)

## What Problem This Solves

Fixes: when an agent asks OpenClaw to change config, restart, or manage plugins/channels/agents, the approval never reaches chats without a native approval card, and `/approve <id>` rejects it. The agent's tool call then blocks until the 10-minute expiry, and users are sent to the Control UI or a terminal to approve a change they asked for in chat.

## User Impact

User impact: every approval an agent needs can be completed in the chat where it was requested.
- Native approval cards (Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Teams, iMessage, Google Chat) keep owning their chats.
- Every other requesting chat now gets the change summary with **Allow once** / **Deny** buttons where the channel renders them, plus a `/approve <id> allow-once|deny` line.
- `/approve` now resolves OpenClaw change approvals, not only exec and plugin approvals.

No config options, protocol, or schema changes.

## Why This Change Was Made

Delegated OpenClaw changes ("system-agent" approvals) already had native cards (openclaw#134670). Two gaps remained outside those cards:

- **Request delivery.** The request was created with delivery turned off, so the shared approval forwarder never posted a fallback. The forwarder now has a system-agent strategy that always targets the requesting chat and is suppressed whenever that chat's native card handles the request. It uses the same typed-button payload and resolved/expired messages as exec and plugin approvals. The system-agent owner publishes the outcome of a decision (applied, or denied) once; approval publication only adds expiry and cancellation, so a denial produces one chat update. The fallback answers only the live messaging chat that made the request: terminal and Webchat requests never fall back to the session's saved chat, and expiry is reported once, from the Gateway's recorded expiry rather than a local chat timer, so a change approved just before the deadline and applied after it reports its applied outcome instead of a false expiry.
- **`/approve`.** The command probed only exec and plugin approvals. It now also resolves system-agent approvals through the canonical `approval.resolve`, after confirming the id is in `openclaw.approval.list`. Canonical resolution records a kind mismatch as a deny, so `/approve` confirms the owner first instead of probing. On channels with their own approver settings (Telegram, Discord, Slack, …), the Gateway checks the sender as the reviewer, the same check as native buttons. Everywhere else only a configured owner (`commands.ownerAllowFrom`) can approve an OpenClaw change: `/approve` sends the sender as the reviewer, and the Gateway checks owner custody against the current config inside the approval store's final decision guard. An ordinary command-authorized sender is refused, and an owner removed after sending `/approve` cannot complete the decision.

Unchanged: approval authority stays bound to the requesting run; free-text "yes" never approves; Full Access still auto-applies; Control UI and the apps can still decide.

Agent-facing text now says what happens: for runs from messaging channels, the `openclaw` tool description says the change waits for approval in this chat (buttons or `/approve`). Webchat and terminal runs, which the chat fallback cannot reach, are told to approve in the Control UI or OpenClaw apps. The gateway-only prompt line points to `openclaw` and `/restart` instead of "ask human".

## Evidence

Real Telegram (Test Server userbot, Convex-leased credentials, fresh Gateway, mock provider), restricted `exec` mode, agent asks OpenClaw to `set logging.level "info"`:

| Run | Setup | What the user saw | Tap | Result |
|---|---|---|---|---|
| A | tester is owner (native cards on) | 🔒 native approval card, no `/approve` text | **Allow Once** | `answerCallbackQuery` + 2× `editMessageText`: "approved. Applying" → "approved and applied"; final reply delivered |
| C | tester is owner, `channels.telegram.execApprovals.enabled: false` | fallback message with change summary, `/approve <id> allow-once\|deny`, and **Allow Once** button | **Allow Once** | message edited to "approved. Applying…", then "approved and applied" posted; Gateway config on disk has `logging.level: "info"`; final reply delivered |

Telegram Web screenshots from the same leased test account (cropped to the conversation):

| | Pending | After **Allow Once** |
|---|---|---|
| Native card (A) | ![Native Telegram approval card with Allow Once and Deny buttons](https://github.com/user-attachments/assets/5d3de39a-339c-4b7b-80d5-84f5d46cc575) | ![Native card edited to approved and applied, followed by the final reply](https://github.com/user-attachments/assets/3e993ffe-3f85-4941-9f31-0904719ea608) |
| Fallback message (C) | ![Fallback approval message with change summary, /approve line, and Allow Once and Deny buttons](https://github.com/user-attachments/assets/ca78d61c-627e-47b0-9505-66fa7162e540) | ![Fallback message resolved: approved and applying, then approved and applied, then the final reply](https://github.com/user-attachments/assets/fb4b5e28-074b-4f69-bbcb-053398b94c25) |

With no owner configured, the owner-only `openclaw` tool isn't exposed, so no change is proposed (config unchanged). That's the existing design; DM pairing sets the first owner.

qa-channel (no native approval cards), new scenario `system-agent-chat-approval`: the agent's delegated change posts the approval in the requesting conversation. A command-authorized non-owner (`commands.allowFrom` includes them, `ownerAllowFrom` does not) sends `/approve <id> allow-once` and gets "❌ Only the owner can approve OpenClaw changes in this chat."; `logging.level` is unchanged and the approval stays pending. The owner's `/approve <id> allow-once` then resolves it; `logging.level` becomes `info`; exactly one final reply. On `origin/main` the same scenario times out waiting for the approval in the chat.

Tests: `/approve` (resolves a pending OpenClaw change canonically; never submits a canonical decision for an id owned by another kind; on a channel without approver settings, a non-owner and a revoked owner never reach the canonical decision), channel custody (without approver settings only a configured owner holds custody, and only for OpenClaw changes), `approval.resolve` (custody revoked between the request and the final write leaves the approval pending), approval publication (allowed/denied changes leave the chat outcome to the system-agent owner; expired/cancelled are published once), forwarder (requesting chat gets the prompt and outcome without `approvals.*` config; a running native card suppresses it; terminal and Webchat requests never reach the saved session chat; a change applied after the deadline reports its outcome with no false expiry; the recorded expiry is reported once), plus existing gateway approval and system-agent suites. The new owner-custody and single-publisher tests fail with the fix reverted. Shared approval and forwarder fixtures moved to sibling `*.test-support.ts` modules so the test files stay under the line cap. Wall time for the touched suites: `commands-approve` + `approval-publication` + `exec-approval-forwarder` + `system-agent-approval` + `approval` ran in 59.5s across 3 Vitest shards. `pnpm tsgo:core` clean.

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: qa-lab gateway Gateway runtime merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant