fix(approval): route /approve through approval resolver#84678
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-level: current main sends manual approvals through PR rating What the crustacean ranks mean
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. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the resolver-based implementation after maintainer acceptance of the approval-runtime compatibility tradeoff, preserving sender authorization and gateway-scope checks before trusted approval submission. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main sends manual approvals through Is this the best way to solve the issue? Yes: routing through Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4d47f9a4c038. |
5a7677e to
44413c7
Compare
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Velvet Clawlet Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
44413c7 to
c5cd6a8
Compare
c5cd6a8 to
2986a6a
Compare
1aa3bf9 to
8e00da6
Compare
8e00da6 to
7d23a5c
Compare
Summary
/approvecommand submitted approval decisions through the genericcallGatewayhelper. That opened an ordinary transient Gateway request instead of the operator approvals resolver/client path, so approvals that require the trusted approval-runtime client context could be invisible and surface asunknown or expired./approvesubmissions throughresolveApprovalOverGateway. That helper connects via the operator approvals Gateway client path and sends approval decisions with the approval-runtime client context used by the exec/plugin approval managers.plugin:<id>approvals, refreshed focused tests around resolver calls and fallback routing, and documented that/approvehandles exec and plugin approvals.Motivation
/approveshould behave like native approval actions: it needs to resolve through the trusted approval runtime, not through a one-off generic Gateway call. The failure was observed from Slack with/approve plugin:<id>, but the fix is in the shared command path and applies to approval submission generally.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
/approveshould resolve pending exec/plugin approvals through the approval resolver instead of returningunknown or expired approval idbecause the generic Gateway client path cannot see the approval.node --import tsx --input-type=module <temporary proof harness> | tee /tmp/openclaw-pr-84678-approval-proof.txt; thennode scripts/run-vitest.mjs src/auto-reply/reply/commands-approve.test.ts.Focused test output:
/approve plugin:<id> allow-oncein a channel command context resolved a live pending plugin approval throughplugin.approval.resolve, and/approve <exec-id> allow-oncestill resolved an exec approval throughexec.approval.resolve. Gateway events included requested and resolved events for both approval families./approve plugin:<id> allow-oncereturnedFailed to submit approval: unknown or expired approval id.Root Cause (if applicable)
/approvebypassedresolveApprovalOverGatewayand calledcallGatewaydirectly. The generic call did not use the operator approvals client path that supplies the trusted approval-runtime client context required by approval visibility checks.operator.approvalsscope and the approval runtime token;resolveApprovalOverGatewayowns that connection path./approveuses the approval resolver path used by native approval actions.plugin.approval.resolverouting.Regression Test Plan (if applicable)
src/auto-reply/reply/commands-approve.test.ts/approvecallsresolveApprovalOverGatewayinstead ofcallGateway, preserves exec approval submission, routesplugin:<id>submissions to plugin approval resolution, and still enforces configured approvers across the shared command path.User-visible / Behavior Changes
Manual
/approvecommands now submit decisions through the same approval resolver path used by trusted approval clients, so pending exec/plugin approvals can be resolved from channel command surfaces as documented.Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation: N/A.Repro + Verification
Environment
/approvecommand path; verified with a Slack command context and focused command-handler testsSteps
/approve <id> <decision>from a configured approver.resolveApprovalOverGatewayto submit the decision through the operator approvals client path.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
/approve plugin:<id> allow-once, real local Gateway proof for exec/approve <id> allow-once, focused approve-command test suite with exec approvals, plugin approvals, fallback routing, authorization, and gateway-client scopes.Review Conversations
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations