Repository navigation
fix: cancel aborted plugin approvals - #98577
haruaiclone-droid wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 12:30 PM ET / 16:30 UTC. ClawSweeper reviewWhat this changesThe PR adds a Gateway cancellation RPC and uses it when a plugin-tool approval wait is aborted, then renders cancellation as a terminal approval state across approval-card surfaces. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 11 items remain Keep this PR open: current main still has the reported stale-pending-approval gap, but this branch is not safe to merge yet. The new cancellation RPC authorizes by general approval visibility rather than original requester identity, and it only cleans up one abort-aware waiter while another current agent path still leaves its pending approval live; it also needs real after-fix behavior proof. Priority: P2 Review scores
Verification
How this fits togetherPlugin tools register sensitive-action approval records with the Gateway, and agent runtimes wait for a decision. Gateway resolution events then clear pending state and drive Control UI or channel approval-card updates. flowchart LR
A[Plugin tool request] --> B[Gateway pending approval]
B --> C[Agent approval waiter]
C --> D{Agent run aborts}
D -->|Cancel request| E[Gateway authorization check]
E --> F[Terminal approval state]
F --> G[Gateway resolved event]
G --> H[Control UI and channel cards]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The new cancellation RPC crosses the approval authorization boundary and currently permits cancellation based on broad visibility rather than original requester identity. PR surfaceSource +185, Tests +120. Total +305 across 22 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. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Rebase onto the current extracted approval transport, add one requester-only Gateway cancellation authorization rule shared by every agent-owned abort path, preserve the existing terminal event flow, and demonstrate a cancelled approval disappearing from pending state and its visible approval surface. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s native-hook relay obtains a plugin approval identifier, races its wait against AbortSignal, and exits on abort without a Gateway terminal operation; the existing source directly establishes the stale-pending path. Is this the best way to solve the issue? No. Gateway-owned cancellation is the correct owner boundary, but this branch must use requester identity rather than reviewer visibility and cover the other current abort-aware requester before it is the best fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 19d213e7211d. LabelsLabel justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Fixes #98576.
Summary
plugin.approval.cancelas a requester-side terminal RPC for pending plugin approvalswaitDecisionplugin.approval.resolvedcleanup events and render cancelled plugin approvals safelyTests
node scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 OPENCLAW_GATEWAY_PROJECT_SHARDS=0 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/plugin-approval.test.ts src/gateway/method-scopes.test.ts --testTimeout=30000 --reporter=dotnode scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts src/agents/agent-tools.before-tool-call.e2e.test.ts --testNamePattern="unblocks immediately when abort signal fires during waitDecision" --testTimeout=30000 --reporter=verbosenode scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-tools.config.ts src/agents/tools/gateway.test.ts --testTimeout=30000 --reporter=dotnode scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-fast.config.ts src/agents/tools/gateway.test.ts src/plugin-sdk/approval-renderers.test.ts --testTimeout=30000 --reporter=dot(agents file excluded by this config; renderer file ran)node scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-slack.config.ts extensions/slack/src/approval-handler.runtime.test.ts --testTimeout=30000 --reporter=dotnode scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-messaging.config.ts extensions/googlechat/src/approval-handler.runtime.test.ts --testTimeout=30000 --reporter=dotnode scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-discord.config.ts extensions/discord/src/approval-handler.runtime.test.ts --testTimeout=30000 --reporter=dotnode scripts/run-with-env.mjs OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 -- node scripts/run-vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/plugin-approval-forwarder.test.ts --testTimeout=30000 --reporter=dotgit diff --checknode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfotimed out after 240s on this Windows/OneDrive checkout; lingering tsgo processes were stopped.