Repository navigation
feat(ios): add exec approval notification flow - #60239
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ac5b07c6c
ℹ️ 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".
Greptile SummaryThis PR adds a complete iOS exec-approval notification flow: a generic APNs alert push (no command text on the lock screen), a scoped Key design decisions are sound:
One minor observation:
Confidence Score: 5/5Safe to merge; the security model is sound, state handling is correct, and no P0/P1 issues were found. All findings are P2 style observations. The security design (generic push payloads, scope-gated detail fetch, cleanup push targeting) is well-thought-out. iOS state management handles concurrency edge cases correctly. Tests are provided for the new gateway methods, APNs helpers, method scope, and iOS notification bridge. src/infra/push-apns.ts lines 903–931 — the unused Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/infra/push-apns.ts
Line: 903-931
Comment:
**Unused `nodeId` parameter in exec-approval payload builders**
Both `createExecApprovalAlertPayload` (line 903) and `createExecApprovalResolvedPayload` (line 920) accept `nodeId` in their parameter types but never reference `params.nodeId` in the returned `openclaw` object. This is intentional — exposing the device's node ID in a lock-screen-visible or background push would leak internal device identity — but the silent omission is not explained anywhere.
Contrast this with `toPushMetadata`, which deliberately includes `nodeId`. A future reader seeing `nodeId` in the signature of these functions may assume it was accidentally forgotten and add it back, inadvertently exposing device identity on the lock screen.
Consider either dropping `nodeId` from the local payload-builder signatures (the callers already have `params.registration.nodeId` available if needed later), or adding a brief comment:
```ts
// nodeId is intentionally omitted from the openclaw payload to keep
// the push lock-screen-safe and avoid leaking device identity.
function createExecApprovalAlertPayload(params: { nodeId: string; approvalId: string }): object {
```
How can I resolve this? If you propose a fix, please make it concise.Greploops — Automatically fix all review issues by running Reviews (2): Last reviewed commit: "fix(gateway): harden approval notificati..." | Re-trigger Greptile |
1e3af8a to
25897b9
Compare
25897b9 to
b35d417
Compare
512b9c0 to
f6223e6
Compare
3ac5b07 to
04f04de
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04f04de513
ℹ️ 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".
|
Addressed the current review feedback and pushed follow-up commit What changed:
Validation run:
Please re-review when you get a chance. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e3b1d096f
ℹ️ 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".
| self.startOperatorGatewayLoop( | ||
| url: cfg.url, | ||
| stableID: effectiveStableID, | ||
| token: cfg.token, | ||
| bootstrapToken: cfg.bootstrapToken, |
There was a problem hiding this comment.
Respect bootstrap guard before restarting operator loop
ensureOperatorReconnectLoopIfNeeded now starts startOperatorGatewayLoop whenever operatorGatewayTask is nil, but it no longer checks shouldStartOperatorGatewayLoop. In sessions where activeGatewayConnectConfig.bootstrapToken is still set, this bypasses the existing “wait for bootstrap handoff” rule and can start the operator loop with a bootstrap token, which risks consuming/redeeming the bootstrap token before normal handoff completes and can break reconnect/onboarding behavior for those bootstrap-driven clients.
Useful? React with 👍 / 👎.
| await clearStaleApnsRegistrationIfNeeded({ | ||
| nodeId: target.nodeId, | ||
| registration: target.registration, | ||
| result, | ||
| }); |
There was a problem hiding this comment.
Don’t fail route detection on registration-cleanup errors
The per-target request delivery path treats clearStaleApnsRegistrationIfNeeded failures as rejected push deliveries because it is awaited inside the same promise. If APNs send succeeds but stale-registration cleanup throws (for example due to pairing-state I/O failures), the target is counted as undelivered, and handleRequested can return false/no-approval-route even though the approval alert actually reached the device. Cleanup should be best-effort logging, not part of delivery success accounting.
Useful? React with 👍 / 👎.
|
@greptile please re-review the latest PR head. The previously flagged iOS follow-ups have been addressed on the current commit, and we'd like an updated score/comment pass on the latest diff. |
1e3b1d0 to
fdcccb5
Compare
|
Landed via temp rebase onto main.
Thanks @ngutman! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdcccb5096
ℹ️ 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".
| if (opts?.iosPushDelivery?.handleRequested) { | ||
| try { | ||
| deliveredToIosPush = await opts.iosPushDelivery.handleRequested(requestEvent); | ||
| } catch (err) { |
There was a problem hiding this comment.
Avoid blocking approval requests on iOS push delivery
This path awaits iosPushDelivery.handleRequested(...) before deciding whether to send the immediate accepted response, even when another approval route is already available (hasExecApprovalClients, forwarded, or hasTurnSourceRoute). Because iOS delivery now waits for APNs send completion, requests can be delayed by push network latency/timeouts and callers can hit RPC timeouts despite already having a viable non-iOS route. Consider only waiting on iOS delivery when it is the final fallback route, and otherwise dispatching it asynchronously.
Useful? React with 👍 / 👎.
| const deliveryState = await deliveryStatePromise; | ||
| if (pendingDeliveryStateById.get(request.id) === deliveryStatePromise) { | ||
| pendingDeliveryStateById.delete(request.id); | ||
| } |
There was a problem hiding this comment.
Clear pending iOS delivery entries on delivery-plan failure
If deliveryStatePromise rejects (for example, pairing/APNs registration reads throw), execution exits before pendingDeliveryStateById is cleaned up. That stale rejected promise is then re-awaited by handleResolved/handleExpired, which fails before their delete calls, so entries can accumulate and cleanup pushes for those approvals will keep erroring. The pending map deletion should run in a finally/rejection path as well.
Useful? React with 👍 / 👎.
* fix(auth): hand off qr bootstrap to bounded device tokens * feat(ios): add exec approval notification flow * fix(gateway): harden approval notification delivery * docs(changelog): add ios exec approval entry (openclaw#60239) (thanks @ngutman)
* fix(auth): hand off qr bootstrap to bounded device tokens * feat(ios): add exec approval notification flow * fix(gateway): harden approval notification delivery * docs(changelog): add ios exec approval entry (openclaw#60239) (thanks @ngutman)
* fix(auth): hand off qr bootstrap to bounded device tokens * feat(ios): add exec approval notification flow * fix(gateway): harden approval notification delivery * docs(changelog): add ios exec approval entry (openclaw#60239) (thanks @ngutman)
* fix(auth): hand off qr bootstrap to bounded device tokens * feat(ios): add exec approval notification flow * fix(gateway): harden approval notification delivery * docs(changelog): add ios exec approval entry (openclaw#60239) (thanks @ngutman)
* fix(auth): hand off qr bootstrap to bounded device tokens * feat(ios): add exec approval notification flow * fix(gateway): harden approval notification delivery * docs(changelog): add ios exec approval entry (openclaw#60239) (thanks @ngutman)
* fix(auth): hand off qr bootstrap to bounded device tokens * feat(ios): add exec approval notification flow * fix(gateway): harden approval notification delivery * docs(changelog): add ios exec approval entry (openclaw#60239) (thanks @ngutman)
Summary
exec.approval.getfetch-on-open RPC, and an in-app iOS modal that resolves through the existing approval backend flow.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
git blame, prior PR, issue, or refactor if known): split out from the broader iOS exec approval work previously carried onios/exec-approval-push/ PR feat(ios): add exec approval push flow #59732.Regression Test Plan (if applicable)
src/gateway/exec-approval-ios-push.test.tssrc/gateway/server-methods/server-methods.test.tssrc/infra/push-apns.test.tssrc/gateway/method-scopes.test.tsapps/ios/Tests/ExecApprovalNotificationBridgeTests.swiftapps/ios/Tests/NodeAppModelInvokeTests.swiftexec.approval.get, and the modal resolves via the existing approval decision flow while resolved pushes dismiss stale notification state.User-visible / Behavior Changes
Allow Once,Allow Always(when permitted),Deny, andCancel.Diagram (if applicable)
Security Impact (required)
Yes/No) YesYes/No) NoYes/No) YesYes/No) NoYes/No) YesYes, explain risk + mitigation:exec.approval.get; the method is gated byoperator.approvals; push delivery targets active operator tokens with effective approval scope; cleanup pushes are skipped when original target sets are unknown.Repro + Verification
Environment
ios/qr-bootstrap-fixesSteps
exec.approval.get, and resolve from the modal.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
Review Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations