Repository navigation
feat(gateway): deliver plugin approvals to paired iOS devices via APNs - #108505
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd7ed9ba80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "plugin", | ||
| resolveCanonicalPluginApprovalRequestAllowedDecisions, | ||
| ); | ||
| const pluginApprovalIosPushDelivery = createPluginApprovalIosPushDelivery({ log: params.log }); |
There was a problem hiding this comment.
Gate plugin pushes on iOS support
When any paired device is still running the current iOS app, this unconditional wiring sends plugin.approval.requested APNs payloads to clients that cannot route them: apps/ios/Sources/Push/ExecApprovalNotificationBridge.swift:61 only recognizes exec.approval.requested, and the notification delegate only parses exec approval prompts. Since the gateway APNs registration stored here has no client capability/version bit, a gateway update can produce plugin approval notifications that launch the app without opening an approval UI; gate plugin APNs on an advertised client capability or keep it disabled until the iOS handler ships.
Useful? React with 👍 / 👎.
| title: normalizeOptionalString(params.title) ?? "Approval required", | ||
| body: resolvePluginApprovalAlertBody(params.description), |
There was a problem hiding this comment.
Keep plugin details out of APNs alerts
For plugin approvals whose prompt text includes sensitive operands, this puts those details directly in the APNs alert title/body, which iOS/watch can display on the lock screen; for example extensions/file-transfer/src/shared/node-invoke-policy.ts:153 builds the title and description with the requested path. Exec approval APNs intentionally use generic text and omit command details, so plugin pushes should do the same and let the app fetch/render the full approval after unlock.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 15, 2026, 8:25 PM ET / July 16, 2026, 00:25 UTC. Summary PR surface: Source +293, Tests +420. Total +713 across 15 files. Reproducibility: yes. at source level: current main only routes exec approval notifications, while the PR unconditionally sends a new plugin event and copies plugin text into its visible APNs alert. No real-device reproduction transcript is provided. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Use a generic non-sensitive notification, advertise and require an explicit plugin-approval push capability, land the matching iOS handler, and prove request, tap-to-dialog, resolution cleanup, direct/relay delivery, and mixed-version behavior on real paired devices before release. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main only routes exec approval notifications, while the PR unconditionally sends a new plugin event and copies plugin text into its visible APNs alert. No real-device reproduction transcript is provided. Is this the best way to solve the issue? No. Sharing the delivery driver is reasonable, but the maintainable solution also needs capability negotiation, generic notification text, a coordinated client implementation, and mixed-version proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 87079d025e83. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +293, Tests +420. Total +713 across 15 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
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. How this review workflow works
|
Generalize the exec-approval iOS push delivery into a shared driver so plugin approvals also raise an APNs notification on paired operator devices (which iOS mirrors to a paired Apple Watch). Reuses the operator.approvals scope gate, direct/relay transport, and stale-registration cleanup. Wires push into both plugin-approval origination points (the plugin.approval.request RPC and the node.invoke policy path) alongside the existing chat forwarder; adds a plugin.approval.* APNs payload/category with a description body truncated to 256 UTF-16-safe chars and no secret-bearing fields.
dd7ed9b to
791246f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 791246f5f6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| isTargetVisible: (target) => | ||
| isApprovalRecordVisibleToClient({ |
There was a problem hiding this comment.
Use durable approval visibility for plugin push targets
When a plugin approval is created without approvalReviewerDeviceIds (for example agent/tool contexts that have no current reviewer device), this new APNs gate uses the legacy exact-requester helper, so the synthetic iOS target is rejected because bindApprovalRequesterMetadata records the backend/requesting device or client, not the paired iPhone. The durable approval.get path uses canAccessOperatorApproval and would allow an operator.approvals device when no reviewer binding exists, so these approvals remain reviewable in-app but never get the new native push; the same gate in src/gateway/node-invoke-plugin-policy.ts should be updated too.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
openclaw#108505) * feat(gateway): deliver plugin approvals to paired iOS devices via APNs Generalize the exec-approval iOS push delivery into a shared driver so plugin approvals also raise an APNs notification on paired operator devices (which iOS mirrors to a paired Apple Watch). Reuses the operator.approvals scope gate, direct/relay transport, and stale-registration cleanup. Wires push into both plugin-approval origination points (the plugin.approval.request RPC and the node.invoke policy path) alongside the existing chat forwarder; adds a plugin.approval.* APNs payload/category with a description body truncated to 256 UTF-16-safe chars and no secret-bearing fields. * fix(gateway): drop unused export on plugin approval push category
Extend the iOS approval handling from exec to plugin approvals so the native push the gateway now sends (#108505) shows a phone notification with Allow/Deny. Extract a shared ApprovalNotificationBridge with exec/plugin wrappers owning their own kind constants and category; tag the parsed prompt with its kind; register the plugin category and route plugin pushes in the app delegate; add a .plugin case that maps the plugin presentation (title/description/pluginId/ severity) into the existing prompt and widens the exec-only validation, current, cache-restore, and resolve guards to accept plugin; parameterize the dialog copy by kind. Watch snapshot publication stays exec-only; the phone notification still mirrors to the watch via WatchConnectivity. Reuses the unified approval.get/ approval.resolve RPCs (already kind-generic); no server or protocol changes.
Extend the iOS approval handling from exec to plugin approvals so the native push the gateway now sends (#108505) shows a phone notification with Allow/Deny. Extract a shared ApprovalNotificationBridge with exec/plugin wrappers owning their own kind constants and category; tag the parsed prompt with its kind; register the plugin category and route plugin pushes in the app delegate; add a .plugin case that maps the plugin presentation (title/description/pluginId/ severity) into the existing prompt and widens the exec-only validation, current, cache-restore, and resolve guards to accept plugin; parameterize the dialog copy by kind. Watch snapshot publication stays exec-only; the phone notification still mirrors to the watch via WatchConnectivity. Reuses the unified approval.get/ approval.resolve RPCs (already kind-generic); no server or protocol changes.
Extend the iOS approval handling from exec to plugin approvals so the native push the gateway now sends (#108505) shows a phone notification with Allow/Deny. Extract a shared ApprovalNotificationBridge with exec/plugin wrappers owning their own kind constants and category; tag the parsed prompt with its kind; register the plugin category and route plugin pushes in the app delegate; add a .plugin case that maps the plugin presentation (title/description/pluginId/ severity) into the existing prompt and widens the exec-only validation, current, cache-restore, and resolve guards to accept plugin; parameterize the dialog copy by kind. Watch snapshot publication stays exec-only; the phone notification still mirrors to the watch via WatchConnectivity. Reuses the unified approval.get/ approval.resolve RPCs (already kind-generic); no server or protocol changes.
…#108709) * feat(ios): render plugin approvals as native Allow/Deny notifications Extend the iOS approval handling from exec to plugin approvals so the native push the gateway now sends (#108505) shows a phone notification with Allow/Deny. Extract a shared ApprovalNotificationBridge with exec/plugin wrappers owning their own kind constants and category; tag the parsed prompt with its kind; register the plugin category and route plugin pushes in the app delegate; add a .plugin case that maps the plugin presentation (title/description/pluginId/ severity) into the existing prompt and widens the exec-only validation, current, cache-restore, and resolve guards to accept plugin; parameterize the dialog copy by kind. Watch snapshot publication stays exec-only; the phone notification still mirrors to the watch via WatchConnectivity. Reuses the unified approval.get/ approval.resolve RPCs (already kind-generic); no server or protocol changes. * chore(i18n): sync native inventory after rebase * chore(ios): drop accidentally committed local Version.xcconfig build override * fix(ios): sync Apple i18n catalog and remove dead approval-bridge methods Sync apps/ios/Resources/Localizable.xcstrings for the new plugin-approval strings (native inventory sync alone did not cover the Apple catalog). Remove the superseded per-bridge registerCategory variants and the redundant exec parseResolvedPush wrapper flagged by the iOS Periphery dead-code scan; registration uses ApprovalNotificationBridge.registerCategories and the shared parse helpers. * chore(ios): drop generated SwiftSources filelist; reconcile native i18n inventory * chore(ios): drop generated Xcode project from tracking Codex generated OpenClaw.xcodeproj for its simulator test run and the initial apps/ios directory commit force-added it; xcodegen regenerates it in CI, so it must not be tracked (matches main). * chore(ios): reconcile native i18n inventory after rebase
…openclaw#108709) * feat(ios): render plugin approvals as native Allow/Deny notifications Extend the iOS approval handling from exec to plugin approvals so the native push the gateway now sends (openclaw#108505) shows a phone notification with Allow/Deny. Extract a shared ApprovalNotificationBridge with exec/plugin wrappers owning their own kind constants and category; tag the parsed prompt with its kind; register the plugin category and route plugin pushes in the app delegate; add a .plugin case that maps the plugin presentation (title/description/pluginId/ severity) into the existing prompt and widens the exec-only validation, current, cache-restore, and resolve guards to accept plugin; parameterize the dialog copy by kind. Watch snapshot publication stays exec-only; the phone notification still mirrors to the watch via WatchConnectivity. Reuses the unified approval.get/ approval.resolve RPCs (already kind-generic); no server or protocol changes. * chore(i18n): sync native inventory after rebase * chore(ios): drop accidentally committed local Version.xcconfig build override * fix(ios): sync Apple i18n catalog and remove dead approval-bridge methods Sync apps/ios/Resources/Localizable.xcstrings for the new plugin-approval strings (native inventory sync alone did not cover the Apple catalog). Remove the superseded per-bridge registerCategory variants and the redundant exec parseResolvedPush wrapper flagged by the iOS Periphery dead-code scan; registration uses ApprovalNotificationBridge.registerCategories and the shared parse helpers. * chore(ios): drop generated SwiftSources filelist; reconcile native i18n inventory * chore(ios): drop generated Xcode project from tracking Codex generated OpenClaw.xcodeproj for its simulator test run and the initial apps/ios directory commit force-added it; xcodegen regenerates it in CI, so it must not be tracked (matches main). * chore(ios): reconcile native i18n inventory after rebase
openclaw#108505) * feat(gateway): deliver plugin approvals to paired iOS devices via APNs Generalize the exec-approval iOS push delivery into a shared driver so plugin approvals also raise an APNs notification on paired operator devices (which iOS mirrors to a paired Apple Watch). Reuses the operator.approvals scope gate, direct/relay transport, and stale-registration cleanup. Wires push into both plugin-approval origination points (the plugin.approval.request RPC and the node.invoke policy path) alongside the existing chat forwarder; adds a plugin.approval.* APNs payload/category with a description body truncated to 256 UTF-16-safe chars and no secret-bearing fields. * fix(gateway): drop unused export on plugin approval push category
…openclaw#108709) * feat(ios): render plugin approvals as native Allow/Deny notifications Extend the iOS approval handling from exec to plugin approvals so the native push the gateway now sends (openclaw#108505) shows a phone notification with Allow/Deny. Extract a shared ApprovalNotificationBridge with exec/plugin wrappers owning their own kind constants and category; tag the parsed prompt with its kind; register the plugin category and route plugin pushes in the app delegate; add a .plugin case that maps the plugin presentation (title/description/pluginId/ severity) into the existing prompt and widens the exec-only validation, current, cache-restore, and resolve guards to accept plugin; parameterize the dialog copy by kind. Watch snapshot publication stays exec-only; the phone notification still mirrors to the watch via WatchConnectivity. Reuses the unified approval.get/ approval.resolve RPCs (already kind-generic); no server or protocol changes. * chore(i18n): sync native inventory after rebase * chore(ios): drop accidentally committed local Version.xcconfig build override * fix(ios): sync Apple i18n catalog and remove dead approval-bridge methods Sync apps/ios/Resources/Localizable.xcstrings for the new plugin-approval strings (native inventory sync alone did not cover the Apple catalog). Remove the superseded per-bridge registerCategory variants and the redundant exec parseResolvedPush wrapper flagged by the iOS Periphery dead-code scan; registration uses ApprovalNotificationBridge.registerCategories and the shared parse helpers. * chore(ios): drop generated SwiftSources filelist; reconcile native i18n inventory * chore(ios): drop generated Xcode project from tracking Codex generated OpenClaw.xcodeproj for its simulator test run and the initial apps/ios directory commit force-added it; xcodegen regenerates it in CI, so it must not be tracked (matches main). * chore(ios): reconcile native i18n inventory after rebase
What Problem This Solves
Exec approvals reach paired iOS operator devices via APNs push, but plugin approvals do not — they only reach chat via the forwarder. So an agent blocked on a plugin approval (for example the
onepasswordbroker'sapprovetier) raised no native notification on the operator's phone or watch. This wires plugin approvals into the same APNs delivery, so they raise a native notification on paired iOS devices, which iOS then mirrors to a paired Apple Watch.Follow-up to the 1Password broker work (#105924). The iOS client change to render the plugin-approval notification/dialog is a separate PR; this is the server half.
Why This Change Was Made
operator.approvals+operator.readscope gate, APNs registration loading, direct/relay delivery planning, and stale-registration cleanup. Exec and plugin drivers supply their own APNs senders; the transport/relay/auth logic stays single-sourced.plugin.approval.requested/plugin.approval.resolvedAPNs payloads and aopenclaw.plugin-approvalcategory. Title comes from the approval request (fallback "Approval required"); body is the request description truncated to 256 UTF-16-safe characters. No secret-bearing fields are added — plugin approval title/description are plugin/operator-authored and never contain the secret value.plugin.approval.requestRPC handler and thenode.invokepolicy path both fan out to the existing chat forwarder plus the new iOS push, using the sameisTargetVisiblepredicate exec uses to skip a device already viewing the approval in-app. Resolution and expiry send the same cleanup wake exec does.No new config surface: native push follows exec's behavior (always enabled for eligible paired operator devices);
approvals.plugin.enabledremains the chat-forwarding gate.User Impact
Operators with a paired iOS device (and optionally a watch) now get a native approval notification for plugin approvals, in addition to the existing chat forward. Opt-in only in the sense that it requires a paired operator device with the approvals scope; no behavior change for setups without one. Exec approval behavior is unchanged.
Evidence
exec-approval-ios-push(13),push-apns(18),plugin-approval(33),approval(33),node-invoke-plugin-policy(16),server-request-context(5),server-aux-handlers(12) — covering direct and relay delivery, scope-gate filtering, lifecycle cleanup, and payload construction incl. body truncation and category/kind.git diff --checkclean.