Skip to content

fix(ios): preserve setup after bootstrap preparation refuses - #160218

Merged
steipete merged 4 commits into
mainfrom
deslop/l116-ios-bootstrap-refusal
Sep 28, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l116-ios-bootstrap-refusal

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes iOS setup continuing after safe replacement of a Gateway's offline data fails. Onboarding clears the entered code and attempts connection; Settings also saves the replacement endpoint and credentials.

User Impact

A refused bootstrap setup keeps the current manual endpoint and entered code available for retry, and shows the existing failure message. Successful setup keeps its current cleanup and credential owners. No message text, protocol model, schema, migration, signing, entitlement, or installer behavior changes.

Why This Change Was Made

Both setup-link helpers return whether preparation succeeded, and all five callers stop on refusal. Endpoint and credential assignments follow successful preparation. The regression drives the real onboarding Apply and Settings Connect actions using Foundation's argument domain to supply a malformed legacy Watch queue; it adds no production test hook.

Evidence

Native red/green proof passed. Final candidate 13fe7fa passed exact-head PR CI, including iOS compilation, simulator tests, and both iPhone/iPad screenshot jobs. Local iOS and embedded Watch compilation passed under nice priority 10 with two jobs (3,279.367 seconds under host load). Final Testbox gates passed. This PR is READY-TO-LAND and remains unarmed. Temporary manual-main selection is removed; the UI regression remains registered in existing full/manual validation.

  • Original-code baseline ran both UI cases and failed exactly BOOTSTRAP_REFUSAL_NOT_PRESERVED. Both app logs record offline removal refusing with WATCH_UNAVAILABLE before the callers continue to the replacement endpoint. Inspected synthetic before/after captures were delivered in chat and verified rendering inline in GitHub below.
  • Fixed native run at 2d5a0f1 passed both regression cases and Watch delivery, plus 467 lifecycle/controller, 6 logic and 87 voice/media/typography tests. Onboarding took 66.858 seconds; Settings took 42.145 seconds. Their app-level cost protects private SwiftUI caller behavior that the already-correct cleanup helper tests cannot exercise. The broader manual runs contain inherited non-native failures and are not claimed as wholly green.
  • Blacksmith Testbox tbx_01m3jv0saqbw4twe0fwq12z21x passed frozen installation and all 475 workflow-fixture assertions in 88.86 seconds; the lifecycle fixture took 1.739 seconds. The lease is stopped. Final Blacksmith Testbox tbx_01m3kkn7047c8g4xpap258tn46 verified candidate 13fe7fa and passed frozen installation, node scripts/check-changed.mjs (480.609 seconds), pnpm protocol:check (2.902 seconds), pnpm native:i18n:verify (2.465 seconds), and all 511 tests in both workflow-fixture files (142.386 seconds; lifecycle fixture 23 tests in 2.691 seconds); combined gate time was 628.574 seconds. The lease is stopped; its hydration run identifies the provider session. An earlier lease expired during local source preparation before executing any check; no pass is attributed to it.
  • Independent Codex review is complete with no actionable finding. The UI tests compare actual Host/Port before and after refusal, retain the exact code and enabled retry, and verify the existing error. These private SwiftUI callers require an app-level regression: the cleanup helper already returns failure correctly. They run in full/manual validation, not ordinary PR UI selection.

The initial Settings probe failed before submission because XCTest retained pre-scroll field frames. Its result is not counted as product proof. The corrected driver returns the list to its top, awaits the keyboard, verifies the entered value, and reached the intended baseline failure in the run linked above. No timeout, workload, or behavior assertion was weakened.

Before and after

Flow Before: refusal overwritten by connection After: refusal and input preserved
Onboarding Onboarding before Onboarding after
Settings Settings before Settings after

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: ios App: ios size: M labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 28, 2026, 6:59 AM ET / 10:59 UTC (Revision 6).

ClawSweeper review

What this changes

The branch makes iOS onboarding and Gateway Settings stop on refused bootstrap preparation, and adds simulator regression cases, manual CI coverage, and troubleshooting guidance.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 8 items remain

Current main still continues after bootstrap preparation refuses. This PR addresses that failure, but two previously identified ownership races remain on the pinned head and block merge.

Priority: P2
Reviewed head: 13fe7faa9bbfde586673af25e2a069a663560787

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The refusal flow has useful native evidence, but two ownership races and missing final-effect authority proof prevent merge readiness.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: Inspected before/after iOS simulator screenshots support refusal handling in onboarding and Settings, and exact-head CI passed. They do not show a canceled or replaced attempt being rejected before final endpoint, credential, staged-link, and connection effects. No stored-data format changed; redact private addresses, keys, phone numbers, and endpoints from added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: Inspected before/after iOS simulator screenshots support refusal handling in onboarding and Settings, and exact-head CI passed. They do not show a canceled or replaced attempt being rejected before final endpoint, credential, staged-link, and connection effects. No stored-data format changed; redact private addresses, keys, phone numbers, and endpoints from added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 9 items Current main still has the refusal defect: Current main awaits setup application and then clears the code and continues without checking whether bootstrap preparation succeeded.
Changed Settings commit point: The introduced path awaits preparation, then assigns the manual endpoint and saves credentials without rechecking the setup attempt.
Changed staged-link consumption: The branch moves consumption of the staged link after awaited preparation, while the link identity check remains before that await.
Findings 2 actionable findings [P1] Revalidate the setup attempt after preparation
[P1] Consume only the staged link this attempt prepared
Security Needs attention Stale setup authority can reach credential storage: Attempt and link identity are checked before awaited preparation, but credential writes occur afterward; cancellation or replacement can leave an older setup attempt authorized at the final write.

How this fits together

The iOS setup flow accepts a code, QR scan, or setup link, chooses a Gateway endpoint, and prepares local data before saving credentials. It then connects the device to the selected Gateway.

flowchart LR
A[Setup code or link] --> B[iOS setup attempt]
B --> C[Choose Gateway endpoint]
C --> D[Prepare offline data]
D --> E{Attempt and link still current?}
E -->|Yes| F[Save endpoint and credentials]
F --> G[Connect to Gateway]
E -->|No| H[Keep current setup]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: Inspected before/after iOS simulator screenshots support refusal handling in onboarding and Settings, and exact-head CI passed. They do not show a canceled or replaced attempt being rejected before final endpoint, credential, staged-link, and connection effects. No stored-data format changed; redact private addresses, keys, phone numbers, and endpoints from added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Revalidate the setup attempt after preparation (P1) - This new awaited path can resume after view disappearance or another action invalidates the attempt. It then assigns the old endpoint and saves its credentials without another ownership check. Recheck the active attempt immediately before these effects in Settings and onboarding.
  • Consume only the staged link this attempt prepared (P1) - A new setup request can stage link B while link A's preparation is suspended. The identity guard precedes that await, but the moved take follows it, so A can consume B and continue with A's endpoint and credentials. Recheck or conditionally consume the exact staged link after preparation; the Settings staged-link clear needs the same protection.
  • Resolve security concern: Stale setup authority can reach credential storage - Attempt and link identity are checked before awaited preparation, but credential writes occur afterward; cancellation or replacement can leave an older setup attempt authorized at the final write.
  • Resolve merge risk (P1) - The supplied native proof covers an uninterrupted refusal, but does not show the final endpoint, credential, and connection effects when preparation finishes after an attempt is canceled or its staged link is replaced.
  • Complete next step (P2) - Repair both post-preparation ownership races and show final-effect rejection for canceled and replaced setup attempts before merge. Redact private details from proof; updating the PR body should trigger re-review, or a maintainer can request @clawsweeper re-review.
  • Improve patch quality - Recheck attempt and staged-link ownership after awaited preparation and before every final state or connection effect.
  • Improve patch quality - Add final-effect proof for a canceled attempt and a replacement link, including which endpoint and credentials remain afterward.

Findings

  • [P1] Revalidate the setup attempt after preparation — apps/ios/Sources/Design/SettingsProTabActions.swift:352-355
  • [P1] Consume only the staged link this attempt prepared — apps/ios/Sources/Onboarding/OnboardingWizardView.swift:972-973
  • [medium] Stale setup authority can reach credential storage — apps/ios/Sources/Onboarding/OnboardingWizardView.swift:1014
Agent review details

Security

Needs attention: The asynchronous setup paths can apply credentials for a superseded Gateway choice.

PR surface

Tests +1, Docs +1, Config +1, Other +152. Total +155 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 2 +1
Docs 1 1 0 +1
Config 1 1 0 +1
Generated 0 0 0 0
Other 3 174 22 +152
Total 6 179 24 +155

Review metrics

Metric Value Why it matters
Production and test growth production +7 net lines, tests +146 net lines The substantial test addition exercises private SwiftUI actions that the cleanup-helper tests cannot cover.
Native regression cost 2 UI cases, 109.003 seconds combined The cases are placed in full/manual validation rather than the ordinary PR UI selection.

Merge-risk options

Maintainer options:

  1. Preserve current setup ownership (recommended)
    Recheck attempt and staged-link identity after preparation and before endpoint, credential, link-consumption, or connection effects; demonstrate cancellation and replacement at those final effects.

Technical review

Best possible solution:

Keep refusal retryable while allowing only the still-current attempt to apply credentials and consume exactly the link it prepared.

Do we have a high-confidence way to reproduce the issue?

Yes for the reported refusal: current-main source continues after preparation can fail, and the supplied baseline and after screenshots show the user-facing difference. The cancellation and replacement races have a clear source path but no final-effect run.

Is this the best way to solve the issue?

No, not yet. Returning failure from preparation is the right repair boundary, but the callers must revalidate setup ownership after the await and before applying state.

Full review comments:

  • [P1] Revalidate the setup attempt after preparation — apps/ios/Sources/Design/SettingsProTabActions.swift:352-355
    This new awaited path can resume after view disappearance or another action invalidates the attempt. It then assigns the old endpoint and saves its credentials without another ownership check. Recheck the active attempt immediately before these effects in Settings and onboarding.
    Confidence: 0.94
  • [P1] Consume only the staged link this attempt prepared — apps/ios/Sources/Onboarding/OnboardingWizardView.swift:972-973
    A new setup request can stage link B while link A's preparation is suspended. The identity guard precedes that await, but the moved take follows it, so A can consume B and continue with A's endpoint and credentials. Recheck or conditionally consume the exact staged link after preparation; the Settings staged-link clear needs the same protection.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 988be4860740.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded iOS setup repair with meaningful but limited user impact.
  • merge-risk: 🚨 compatibility: A superseded attempt can replace the user's current manual endpoint or consume a newer setup link.
  • merge-risk: 🚨 security-boundary: A stale setup attempt can install Gateway credentials after the operator's current setup choice has changed.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: Inspected before/after iOS simulator screenshots support refusal handling in onboarding and Settings, and exact-head CI passed. They do not show a canceled or replaced attempt being rejected before final endpoint, credential, staged-link, and connection effects. No stored-data format changed; redact private addresses, keys, phone numbers, and endpoints from added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Authority-chain proof required: Inspected before/after iOS simulator screenshots support refusal handling in onboarding and Settings, and exact-head CI passed. They do not show a canceled or replaced attempt being rejected before final endpoint, credential, staged-link, and connection effects. No stored-data format changed; redact private addresses, keys, phone numbers, and endpoints from added proof.

Evidence

Security concerns:

  • [medium] Stale setup authority can reach credential storage — apps/ios/Sources/Onboarding/OnboardingWizardView.swift:1014
    Attempt and link identity are checked before awaited preparation, but credential writes occur afterward; cancellation or replacement can leave an older setup attempt authorized at the final write.
    Confidence: 0.91

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-28T06:54:03.582Z sha 2d5a0f1 :: blocked before merge. :: [P1] Recheck the setup attempt before applying the endpoint
  • reviewed 2026-09-28T08:08:01.301Z sha 2d5a0f1 :: needs real behavior proof before merge. :: [P1] Revalidate the setup attempt after preparation | [P1] Keep a newer staged link when preparation resumes
  • reviewed 2026-09-28T08:32:48.362Z sha 13fe7fa :: needs real behavior proof before merge. :: [P1] Revalidate the setup attempt after preparation | [P1] Consume only the link this attempt prepared
  • reviewed 2026-09-28T09:15:39.086Z sha 13fe7fa :: needs real behavior proof before merge. :: [P1] Recheck setup ownership before selecting the Gateway | [P1] Consume only the link this attempt prepared
  • reviewed 2026-09-28T09:50:01.966Z sha 13fe7fa :: needs real behavior proof before merge. :: [P1] Recheck setup ownership before applying the Gateway target | [P1] Consume only the staged link this attempt prepared

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@steipete
steipete force-pushed the deslop/l116-ios-bootstrap-refusal branch from 2d5a0f1 to 13fe7fa Compare September 28, 2026 08:23
@steipete
steipete marked this pull request as ready for review September 28, 2026 08:25
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@steipete
steipete merged commit bc4a18a into main Sep 28, 2026
239 of 240 checks passed
@steipete
steipete deleted the deslop/l116-ios-bootstrap-refusal branch September 28, 2026 16:25
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…w#160218)

* test(ios): reproduce bootstrap setup refusal

* test(ios): target visible setup input after scrolling

* fix(ios): stop setup after bootstrap preparation refuses

* test(ios): retain release coverage after bootstrap proof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant