Repository navigation
fix(channels): make system-agent approval cards actionable - #147152
Conversation
… and Slack codecs System-agent approval cards rendered by the Discord or Slack native adapters can now be resolved through their transport-private callback codecs. Both kind allowlists stay closed to the three canonical kinds; malformed ids, unknown kinds, and unknown decisions still fail closed. Fixes #137142 (cherry picked from commit 94e963a)
|
🦞👀 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 13, 2026, 2:49 PM ET / 18:49 UTC (Revision 6). ClawSweeper reviewWhat this changesMakes Discord and Slack approval buttons for proposed OpenClaw changes actionable and prevents delayed callbacks from overwriting completed approval cards. Merge readiness✅ Ready for maintainer review This remains a useful repair: current main and the latest release still reject the emitted Discord approval kind. No blocking correctness finding was identified, and the narrowed patch preserves the established account-custody and delivery-selection contracts. Priority: P1 Review scores
Verification
How this fits togetherChannel approval adapters turn Gateway-owned requests into chat cards and send operator decisions back to the Gateway. The Gateway controls authorization and application; channel adapters keep the displayed outcome consistent with that result. flowchart TD
A[Proposed OpenClaw change] --> B[Gateway approval record]
B --> C[Discord or Slack card]
C --> D[Operator button click]
D --> E[Approver and Gateway custody checks]
E --> F[Canonical decision and application]
F --> G[Serialized card updates]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +125, Tests +585. Total +710 across 15 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: Keep Gateway-owned authorization and application intact while both channel adapters serialize presentation updates and preserve final application outcomes. Do we have a high-confidence way to reproduce the issue? Yes: current main emits system-agent approval controls while its Discord and Slack decoders reject that kind before resolution. This review verified the source path and recorded baseline evidence without executing target code. Is this the best way to solve the issue? Yes: repairing the existing codecs and coordinating channel-owned message updates addresses the failure without creating another authorization owner or changing delivery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 144ebea0cb62. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
landpr-approve-admin-merge |
|
landpr-approve-admin-merge |
|
Thanks @LiuwqGit! Proof: Allow Once and Deny callbacks resolved real pending approvals through the Gateway, with final cards preserved in both update orders. Local transport fixtures were used; no human click.
|
* commit 'cf45ff4d6a9c13164463db860285a02c1c4f2e8c': test(macos): observe readiness cancellation and deadline ownership (#145056) fix(ci): route QA Profile Evidence to its run-status owner test (#147293) fix(install): preserve runtime links when Node validation fails (#147221) test(auto-reply): reuse memory session fixtures (#147262) fix: hide subagent sessions from Activity (#147253) ci: record resources for slow runtime test commands (#147254) fix(update): recognize FreeBSD boot identities in triage leases (#147243) refactor(active-memory): share closing tag line scan (#147031) fix: resume Settings autosave after Reload Config (#147136) fix(cli): keep conversation context after cancellation (#147139) fix(channels): make system-agent approval cards actionable (#147152) refactor: retain shared database handles until their last worker closes (#147246) refactor(slack): share workspace-qualified target resolution (#147024) refactor(msteams): remove duplicate quoted-table test (#147270)
* commit 'ac59d5e09eb468dc23cf95e447608b57e71b52af': (176 commits) improve(gateway): avoid redundant startup preflight work (#147285) test(macos): observe readiness cancellation and deadline ownership (#145056) fix(ci): route QA Profile Evidence to its run-status owner test (#147293) fix(install): preserve runtime links when Node validation fails (#147221) test(auto-reply): reuse memory session fixtures (#147262) fix: hide subagent sessions from Activity (#147253) ci: record resources for slow runtime test commands (#147254) fix(update): recognize FreeBSD boot identities in triage leases (#147243) refactor(active-memory): share closing tag line scan (#147031) fix: resume Settings autosave after Reload Config (#147136) fix(cli): keep conversation context after cancellation (#147139) fix(channels): make system-agent approval cards actionable (#147152) refactor: retain shared database handles until their last worker closes (#147246) refactor(slack): share workspace-qualified target resolution (#147024) refactor(msteams): remove duplicate quoted-table test (#147270) fix(qa): bind coverage IDs to producer assertions (#144000) fix(linux): explain FreeBSD desktop setup prerequisites (#147211) fix(memory): split embedding batches rejected for an input array item cap (#139541) test: isolate timing metadata persistence from inherited settings (#147112) refactor(status): retire test-only helper publication (#147071) ...
…147152) ## What Problem This Solves The OpenClaw Change approval card appears, but its buttons cannot approve. A late callback can overwrite the application result, and a Slack card can stay pending after its delivery receipt is lost. ## Fix and Impact Accept the existing three approval kinds in Discord, Slack, and shared presentation validation. Native updates and callbacks share a per-message queue in each channel. Callbacks read current controls before editing, so old pending cards finish and final Applied, Not applied, or Denied cards survive. Native delivery keeps its existing frozen runtime selection from openclaw#121673. Restart/list replay does not send a second card; an authorized operator can still resolve the original card. No schema, migration, config-key, protocol, dependency, or delivery-policy change. Supersedes openclaw#137169 by @LiuwqGit. Contributor authorship is preserved. Reported by @anyech in openclaw#137142. Refs openclaw#134670. ## Consumers The shared presentation normalizer also feeds Telegram and the fallback renderers for other channels. Telegram already accepts the system-agent callback kind. Its existing typed-action tests remain intact. Other renderers retain their existing unsupported-control and text-fallback behavior; this change does not claim native approval support for them. ## Documentation No product documentation change is required. `docs/plugins/sdk-channel-plugins/approvals.md:104` already requires all three kinds and the final application result. The Slack codec unit test covers a direct encoder/decoder round trip; the registered-handler and real Gateway evidence below establish the complete approval flow. ## Evidence - Main `f700a855a470`: both emitted Discord buttons returned “This approval is no longer valid”; SQLite stayed pending and the resolver was not reached. - Slack baseline `fc188ff0b943`: after native delivery and runtime stop, Allow Once and Deny persisted their decisions but left the original card pending with buttons. - Narrowed candidate `b5e76a8386f03380a369dd5150f57b5e488cd64b`: three fresh real Slack handler → Gateway → application/SQLite → card cases passed. Actual stop/start/list replay selects no replacement and sends no second card. Original Allow Once and Deny clear the controls; the threaded case reads and finishes the exact original reply. Full captures: `runtime-narrowed-3.json`. - Retained evidence: 21 non-replay Slack cases at `73fba5283a4b` cover both native/callback orders, Applied/Not applied/Denied, generic controls, stale winners, authority checks, and exec/plugin siblings. Source-aware review confirmed unchanged inputs. These are reused records, not new executions. Earlier replacement-delivery records are historical only. The retained 21 Discord Gateway scenarios cover the real dispatcher, approval resolver, application executor, SQLite results, and final cards against local HTTP responses. The boundary uses a real bundled Gateway and native HTTP clients with isolated local HTTP and deterministic inference fixtures. Recorded harness commands (`SLACK_PROOF` is the retained evidence directory; start runs in a separate terminal): ```sh node "$SLACK_PROOF/start.mjs" narrowed node "$SLACK_PROOF/call.mjs" narrowed node "$SLACK_PROOF/verify.mjs" ``` Fresh merge `f9ccdd51aa0d590adb72d35c83eb937bbe9fa13e` has direct parents candidate `b5e76a8386f03380a369dd5150f57b5e488cd64b` and main `e08263bdd3341031c219bb147638f23a1f4c3c03`. The affected approval lifecycle group passed 836 tests (2 skipped), full Slack passed 3,017, and the Discord native/registered-callback sibling passed 44. All three commands exited 0. ```sh pnpm changed:lanes --json --base f700a85 --head f9ccdd51aa0d590adb72d35c83eb937bbe9fa13e node --import tsx scripts/ci-run-node-test-shard.mts ``` The retained plan and command/result receipts specify each CI config, include list, and environment. Local `pnpm exec oxlint --config .oxlintrc.json` passed for all 15 retained PR files plus both reverted files; `oxlint-final.json` records the exact command and exit. Unchanged suite evidence remains tied to its earlier merge `68930a5e67a2`, rather than being counted as a new run. CI run `34773959228` completed successfully at landing head `f08ae38f5237e35276bdf9bb2f50c68cbe4af31b`, including the previously failing type-aware jobs. The last commit changes only two Discord test fixtures; production and the accepted Gateway evidence are unchanged. Both affected test files also passed all 44 local tests. Limit: no human click. Co-authored-by: LiuwqGit <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
The OpenClaw Change approval card appears, but its buttons cannot approve. A late callback can overwrite the application result, and a Slack card can stay pending after its delivery receipt is lost.
Fix and Impact
Accept the existing three approval kinds in Discord, Slack, and shared presentation validation. Native updates and callbacks share a per-message queue in each channel. Callbacks read current controls before editing, so old pending cards finish and final Applied, Not applied, or Denied cards survive.
Native delivery keeps its existing frozen runtime selection from #121673. Restart/list replay does not send a second card; an authorized operator can still resolve the original card. No schema, migration, config-key, protocol, dependency, or delivery-policy change.
Supersedes #137169 by @LiuwqGit. Contributor authorship is preserved. Reported by @anyech in #137142. Refs #134670.
Consumers
The shared presentation normalizer also feeds Telegram and the fallback renderers for other channels. Telegram already accepts the system-agent callback kind. Its existing typed-action tests remain intact. Other renderers retain their existing unsupported-control and text-fallback behavior; this change does not claim native approval support for them.
Documentation
No product documentation change is required.
docs/plugins/sdk-channel-plugins/approvals.md:104already requires all three kinds and the final application result. The Slack codec unit test covers a direct encoder/decoder round trip; the registered-handler and real Gateway evidence below establish the complete approval flow.Evidence
37130969fa54: both emitted Discord buttons returned “This approval is no longer valid”; SQLite stayed pending and the resolver was not reached.fc188ff0b943: after native delivery and runtime stop, Allow Once and Deny persisted their decisions but left the original card pending with buttons.b5e76a8386f03380a369dd5150f57b5e488cd64b: three fresh real Slack handler → Gateway → application/SQLite → card cases passed. Actual stop/start/list replay selects no replacement and sends no second card. Original Allow Once and Deny clear the controls; the threaded case reads and finishes the exact original reply. Full captures:runtime-narrowed-3.json.73fba5283a4bcover both native/callback orders, Applied/Not applied/Denied, generic controls, stale winners, authority checks, and exec/plugin siblings. Source-aware review confirmed unchanged inputs. These are reused records, not new executions. Earlier replacement-delivery records are historical only. The retained 21 Discord Gateway scenarios cover the real dispatcher, approval resolver, application executor, SQLite results, and final cards against local HTTP responses.The boundary uses a real bundled Gateway and native HTTP clients with isolated local HTTP and deterministic inference fixtures. Recorded harness commands (
SLACK_PROOFis the retained evidence directory; start runs in a separate terminal):Fresh merge
f9ccdd51aa0d590adb72d35c83eb937bbe9fa13ehas direct parents candidateb5e76a8386f03380a369dd5150f57b5e488cd64band mainadb6e518a44218650883f3daec4bd319165e0017. The affected approval lifecycle group passed 836 tests (2 skipped), full Slack passed 3,017, and the Discord native/registered-callback sibling passed 44. All three commands exited 0.The retained plan and command/result receipts specify each CI config, include list, and environment. Local
pnpm exec oxlint --config .oxlintrc.jsonpassed for all 15 retained PR files plus both reverted files;oxlint-final.jsonrecords the exact command and exit. Unchanged suite evidence remains tied to its earlier merge68930a5e67a2, rather than being counted as a new run. CI run34773959228completed successfully at landing headf08ae38f5237e35276bdf9bb2f50c68cbe4af31b, including the previously failing type-aware jobs. The last commit changes only two Discord test fixtures; production and the accepted Gateway evidence are unchanged. Both affected test files also passed all 44 local tests.Limit: no human click.