Repository navigation
fix(ios): drop the unexposed unattended deep-link key - #197172
Conversation
|
🦞👀 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. What this changesThis PR removes iOS unattended agent-link authentication, requires local confirmation, and deletes the retired key at startup. Example: Open openclaw://agent?message=keyed&deliver=1&to=123456&channel=telegram&key=retired-demo-key with that key stored on iOS.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is useful and correct: current main retains the hidden iOS key bypass, and the previous test-sleep finding is resolved. No actionable findings remain; CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe iOS URL handler parses agent links into NodeAppModel, which owns confirmation and forwards approved requests through the paired Gateway node connection. flowchart LR
A[Agent URL] --> B[Shared deep link parser]
B --> C[iOS NodeAppModel]
C --> D[Local confirmation]
D --> E[Sanitized agent request]
E --> F[Paired Gateway]
Technical reviewBest possible solution: Retain the existing iOS confirmation owner, remove its hidden key exception, and scrub only the retired preference. Do we have a high-confidence way to reproduce the issue? Current-main source establishes that a matching stored key bypasses confirmation; the contributor also reports reproducing this through the stable iOS app and a real Gateway. Is this the best way to solve the issue? The patch is the smallest complete fix: it deletes the unused authentication branch, reuses existing confirmation and sanitization, and removes the persisted secret without changing shared or macOS contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a9c961f77748. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -33, Tests +16, Docs +4. Total -13 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed November 11, 2026, 10:42 AM ET / 15:42 UTC (Revision 4). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* fix(ios): drop the unexposed unattended deep-link key * test(ios): keyed deep links with the retired key still need confirmation * test(ios): avoid the prompt-throttle wait in the retired-key regression
Keep credential-bearing pasted codes in view memory and delete legacy preferences at startup. Clear mounted Settings on onboarding reset. Release adaptation: add two guards in the existing native source suite. Native Swift checks remain unrun on this Linux host; qualification required. Independent review omitted per release owner, not passed. Companion #197172 retires a different deep-link key; not a dependency. (cherry picked from commit 66e7e2d) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>

Problem
The iOS app kept a random "unattended deep-link key" in
UserDefaults(deeplink.agent.key). Anopenclaw://agentlink carrying it skipped the confirmation prompt and could send up to 20,000 characters. Unlike macOS (Debug Settings shows the key), iOS never shows the key anywhere, so no user or shortcut can hold it. The result was a secret stored outside the Keychain that only someone reading the app's preferences could use.Solution
gateway.setupCodescrub.apps/ios/AGENTS.md: secrets go through the Keychain store, neverUserDefaults/@AppStorage/plain files.The shared
AgentDeepLink.keyfield stays because macOS uses it.Impact
No visible change: no one could have the iOS key. Links over 240 characters keep being rejected, as they already were for every real link.
Evidence
Upgrade from the latest stable, real Gateway (iOS 27 simulator, isolated
ios-simGateway)6350a4b2df5, Debug), paired by setup code:Gateway: Connected.deeplink.agent.key, 43 chars).deliver=1&to=123456&channel=telegram: no prompt. The message reached the Gateway (2 hits in the node session's history), and the Gateway loggedagent delivery disabled … missing session delivery route (channel=- to=123456), so the delivery fields were sent too.Gateway: Connected(pairing and settings kept), and the stored key was removed (Print: Entry, ":deeplink.agent.key", Does Not Exist).to=123456delivery line in the Gateway log.to=123456delivery line, so the approved request carried no delivery fields.Regression test
handle deep link with retired stored key still requires confirmation: stores the old key, opens a keyed link with delivery fields, and checks: prompt shown, no request sent; Cancel sends nothing; a later approval sends exactly one request withdeliver == false,to == nil,channel == nil.✔ … passed,✔ Test run with 262 tests in 1 suite passed.apps/ios/Sources):✘ … failed after 5.153 seconds with 7 issues: no prompt (pendingAgentDeepLinkPrompt != nilfailed), a request was sent before confirmation (sent.isEmpty×2), and the sent request keptdeliver,toandchannel.Other checks
NodeAppModelInvokeTests: 262 passed on head.swiftformat --lintclean on changed Swift files;git diff --checkclean.