Skip to content

fix(ios): keep reconnect errors visible - #105875

Merged
steipete merged 9 commits into
mainfrom
codex/ios-preserve-reconnect-error
Jul 13, 2026
Merged

steipete merged 9 commits into
mainfrom
codex/ios-preserve-reconnect-error

Conversation

@steipete

@steipete steipete commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

When the iOS app reconnects to the same gateway, the useful connection error was replaced by “Reconnecting…” after a second or two. Users could not read the failure or open its details.

Why This Change Was Made

Retain the last gateway problem as presentation history while a same-target reconnect starts. Keep live node and operator problems separate from that snapshot, so a stale pairing error cannot control a new retry while an active pairing approval still keeps its control state.

Successful connections and new failures replace the retained snapshot. Selecting a different gateway clears it.

This is AI-assisted work. The state precedence and lifecycle boundaries were checked manually and with the repository autoreview gate.

User Impact

The previous gateway error remains readable while iOS reconnects in the background. Explicit retries do not inherit stale pairing pauses; active approval requests remain visible and paused.

Evidence

  • Exact reviewed head: 3efb98d5b4ae34b8897400cf19c9c12b9ff92f58.
  • Focused iOS simulator command: xcodebuild test -project apps/ios/OpenClaw.xcodeproj -scheme OpenClaw -destination 'platform=iOS Simulator,id=1D711F07-E4B8-4236-B814-6BA6335F92B4' -derivedDataPath /tmp/openclaw-ios-105875.wrhBSC -resultBundlePath /tmp/openclaw-ios-105875-retention-suite-v2.xcresult CODE_SIGNING_ALLOWED=NO -only-testing:OpenClawTests/GatewayReconnectErrorRetentionTests.
  • Result: 2 tests in 1 suite passed. Coverage proves retained display history does not control a new retry and active operator approval survives a node cancellation.
  • The Xcode build/test, including its SwiftFormat and SwiftLint build phases, succeeded.
  • node --import tsx scripts/native-app-i18n.ts sync reported changed=false; git diff --check passed.
  • Fresh autoreview: clean, zero accepted/actionable findings; patch correct (0.87).
  • Per maintainer direction, broad hosted CI was not awaited. No physical iPhone was attached for source-blind visual proof.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios size: S maintainer Maintainer-authored PR labels Jul 13, 2026
@steipete steipete self-assigned this Jul 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0416342dd7

ℹ️ 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff3711e609

ℹ️ 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".

{
// A retry may already be running; keep its previous error readable until success clears it.
if let localFailure { return .failedStatus(message: localFailure, allowsRetry: false) }
if let problem { return .failed(problem) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable problem actions while reconnecting

With this precedence, the onboarding problem banner stays in the .failed branch while connectingGateway is set by retryLastAttempt or the certificate-trust path. That branch still renders an enabled Retry/Trust button, and retryLastAttempt has no in-flight guard, so a user who taps the unchanged button again during reconnect can start overlapping attempts that cancel/restart the previous handoff instead of seeing a busy state. Keep the old problem visible, but also surface or disable the active action when connectingDetail is present.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 13, 2026
@clawsweeper

clawsweeper Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 4:51 AM ET / 08:51 UTC.

Summary
Changes iOS gateway and onboarding status precedence to retain reconnect errors, clear them on selected target changes, add regression coverage, remove unused connection/watch helpers, and refresh native localization metadata.

PR surface: Other +160. Total +160 across 11 files.

Reproducibility: yes. at source level for the review defects: setup-code connection with an existing local failure, another Retry or Trust tap while reconnecting, and a different-target TLS preflight provide concrete paths. No live simulator artifact demonstrates them.

Review metrics: none identified.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦪 silver shellfish
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Fix setup-code precedence, reconnect action busy state, and different-target TLS preflight replacement behavior.
  • Rebase onto current main and rerun a complete review of node, operator, pairing, and presentation-state paths.
  • Attach a redacted iOS simulator or device recording demonstrating the corrected behavior.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides simulator tests and static checks but no redacted after-fix simulator or device recording of error retention, busy actions, target switching, and replacement failures. After adding proof, update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review; redact private hosts, IPs, credentials, and device details.

Risk before merge

  • [P1] A setup-code attempt can remain hidden behind an obsolete local failure instead of showing the active connection state.
  • [P1] Keeping the failure branch active during reconnect leaves Retry or Trust actions available and can start overlapping attempts.
  • [P1] A different-target TLS probe failure can be obscured by the previous gateway's retained error.
  • [P1] The conflict resolution may alter the already complex node, operator, pairing, and presentation-state interactions.
  • [P1] The changed user-visible behavior has test-only proof rather than a visible after-fix run.

Maintainer options:

  1. Fix and prove the scoped behavior (recommended)
    Resolve conflicts, correct setup/preflight/action state ownership, add focused regressions, and attach a redacted visible run before merge.
  2. Accept sticky-error interaction risk
    Merge only if the iOS owner explicitly accepts stale-state masking and repeated-action behavior during reconnect.
  3. Pause for state-model work
    Close or defer this branch if correcting the findings requires more one-off precedence patches instead of a bounded presentation-state model.

Next step before merge

  • [P1] An iOS owner must confirm the presentation policy, resolve the dirty base, require fixes for the three state-transition defects, and obtain contributor-owned visible proof.

Maintainer decision needed

  • Question: Should iOS intentionally replace its established reconnect-progress-first behavior with a sticky same-target error as the primary status while a retry is running?
  • Rationale: Current main has a test encoding reconnect progress as the expected state, while this PR deliberately prioritizes diagnostic readability; the permanent UX and interaction contract requires an iOS owner decision.
  • Likely owner: steipete — The maintainer-routed PR and recent iOS gateway work make steipete the best available owner for the intended reconnect UX contract.
  • Options:
    • Scoped sticky error (recommended): Keep the same-target error visible, but add explicit busy state, disable actions, and let setup, target changes, and newer preflight failures replace it.
    • Reconnect progress first: Preserve the current primary reconnect status and expose the previous error through secondary details or history.
    • Refactor state model first: Pause this PR until gateway presentation state is explicitly modeled by target, attempt, and owner rather than precedence checks.

Security
Cleared: The Swift, UI, tests, and generated localization metadata introduce no concrete security or supply-chain concern.

Review findings

  • [P2] Let setup-code progress replace stale local failures — apps/ios/Sources/Onboarding/OnboardingWizardTypes.swift:49
  • [P2] Disable retained-problem actions during reconnect — apps/ios/Sources/Onboarding/OnboardingWizardTypes.swift:50
  • [P2] Replace retained errors on different-target TLS failure — apps/ios/Sources/Status/GatewayStatusBuilder.swift:26
Review details

Best possible solution:

Use an explicit target- and attempt-owned presentation state: retain an error only for the same active target, expose reconnect busy state while disabling its actions, replace it when setup or preflight establishes newer information, and verify the rebased behavior with focused tests plus a redacted simulator or device recording.

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

Yes at source level for the review defects: setup-code connection with an existing local failure, another Retry or Trust tap while reconnecting, and a different-target TLS preflight provide concrete paths. No live simulator artifact demonstrates them.

Is this the best way to solve the issue?

No. Sticky same-target diagnostics may be valuable, but precedence checks without explicit target, attempt, action, and owner state are not the safest maintainable implementation.

Full review comments:

  • [P2] Let setup-code progress replace stale local failures — apps/ios/Sources/Onboarding/OnboardingWizardTypes.swift:49
    resolve returns localFailure before active setup-code progress. A new setup attempt can therefore keep showing the previous local error throughout link resolution instead of the current connection attempt. Clear the stale failure when setup begins or let setup-code progress outrank it.
    Confidence: 0.96
  • [P2] Disable retained-problem actions during reconnect — apps/ios/Sources/Onboarding/OnboardingWizardTypes.swift:50
    Returning the ordinary failed-problem phase while connectingDetail exists keeps Retry or Trust controls in their actionable branch. Another tap can start an overlapping attempt rather than reflecting the active reconnect. Preserve the message if desired, but carry a busy state that disables its action.
    Confidence: 0.94
  • [P2] Replace retained errors on different-target TLS failure — apps/ios/Sources/Status/GatewayStatusBuilder.swift:26
    The unconditional retained-problem precedence also applies when a manual connection to another TLS gateway fails during certificate preflight. That path returns before the target-switch clear runs, so the previous gateway error masks the new probe failure. Clear or replace the retained problem when preflight targets another gateway or produces newer failure information.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The PR changes a bounded but user-visible iOS connection workflow and can obscure current recovery information or restart attempts.
  • merge-risk: 🚨 availability: The changed failure-state precedence can enable overlapping retries and obscure or interfere with gateway recovery paths.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides simulator tests and static checks but no redacted after-fix simulator or device recording of error retention, busy actions, target switching, and replacement failures. After adding proof, update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review; redact private hosts, IPs, credentials, and device details.
Evidence reviewed

PR surface:

Other +160. Total +160 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 11 266 106 +160
Total 11 266 106 +160

What I checked:

  • Existing behavior contract: Current main explicitly tests that a transient gateway problem yields connecting status during reconnect; this PR reverses that established presentation rule rather than restoring a currently documented or tested expectation. (apps/ios/Tests/GatewayStatusBuilderTests.swift:22, d38fc3e2f06c)
  • Setup-code precedence remains incorrect: The final resolver still returns a retained local failure before active setup-code progress, so a new setup attempt can continue displaying an obsolete local error. (apps/ios/Sources/Onboarding/OnboardingWizardTypes.swift:49, 69793bdac70e)
  • Reconnect actions remain active: The resolver returns the ordinary failed-problem state while reconnect progress exists, without carrying a busy state that disables Retry or Trust actions. (apps/ios/Sources/Onboarding/OnboardingWizardTypes.swift:50, 69793bdac70e)
  • Different-target preflight gap: The shared status builder now renders every retained problem as the primary error. Manual TLS preflight can fail before the target-switch clearing path runs, allowing the previous gateway error to mask the new target's probe failure. (apps/ios/Sources/Status/GatewayStatusBuilder.swift:26, 69793bdac70e)
  • Regression coverage gap: Added tests cover same-target retention, selected target changes, and basic phase precedence, but not setup-code handoff with a stale local failure, repeated Retry or Trust taps, or a different-target TLS preflight failure. (apps/ios/Tests/OnboardingConnectPhaseTests.swift:4, 69793bdac70e)
  • Proof and integration state: The PR reports focused simulator tests and static checks but explicitly lacks a visible after-fix simulator or device run; GitHub also reports the current branch as conflict-dirty against main. (69793bdac70e)

Likely related people:

  • steipete: The maintainer-routed discussion and recent iOS gateway, pairing, reconnect, and onboarding work make steipete the clearest owner for the intended state-precedence policy. (role: recent iOS gateway contributor; confidence: high; commits: 37e47a75af3f, ab431cc4210e, 8862da24c780; files: apps/ios/Sources/Model/NodeAppModel.swift, apps/ios/Sources/Onboarding/OnboardingWizardView.swift, apps/ios/Sources/Status/GatewayStatusBuilder.swift)
  • vincentkoc: Recent merged release history credits vincentkoc on the broader iOS Pro UI, gateway, and onboarding refresh that overlaps these reconnect presentation surfaces. (role: adjacent mobile and onboarding contributor; confidence: medium; files: apps/ios/Sources/Model/NodeAppModel.swift, apps/ios/Sources/Onboarding/OnboardingWizardView.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.
Review history (7 earlier review cycles)
  • reviewed 2026-07-13T02:33:02.734Z sha ff3711e6097f3498a82ed936b09dfb7acaf3e89e :: needs real behavior proof before merge. :: [P2] Scope retained errors to the active gateway target
  • reviewed 2026-07-13T03:27:47.991Z sha 906567b :: needs real behavior proof before merge. :: [P2] Retain the problem through same-target reconnect setup | [P2] Clear retained problems when the active route was reset | [P2] Let setup-code progress replace stale local failures | [P2] Disable problem actions while reconnecting
  • reviewed 2026-07-13T05:21:03.605Z sha 3eeb08c1ce636646698527c5369d3d75ed0e387b :: needs real behavior proof before merge. :: [P2] Preserve the error through same-target reconnect setup | [P2] Clear retained errors after a route reset | [P2] Let setup-code progress replace stale local failures | [P2] Disable retained-error actions during reconnect
  • reviewed 2026-07-13T05:36:03.659Z sha 2d07ed9 :: needs real behavior proof before merge. :: [P2] Preserve the problem through same-target reconnect setup | [P2] Clear retained problems when a reset route changes target | [P2] Let setup-code progress replace stale local failures | [P2] Disable retained-problem actions while reconnecting
  • reviewed 2026-07-13T05:50:01.210Z sha 2d07ed9 :: needs real behavior proof before merge. :: [P2] Preserve the problem through same-target reconnect setup | [P2] Clear retained problems when a reset route changes target | [P2] Let setup-code progress replace stale local failures | [P2] Disable retained-problem actions while reconnecting
  • reviewed 2026-07-13T07:34:25.276Z sha 252f85c :: needs real behavior proof before merge. :: [P2] Preserve the problem through the actual same-target retry | [P2] Clear retained errors after route identity resets | [P2] Let setup-code progress replace stale local failures | [P2] Disable retained-problem actions during reconnect
  • reviewed 2026-07-13T07:46:20.467Z sha 8862da2 :: needs real behavior proof before merge. :: [P2] Let setup-code progress replace stale local failures | [P2] Disable retained-problem actions during reconnect

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7eec503cb

ℹ️ 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".

Comment on lines +10685 to +10688
guard let currentStableID = self.activeGatewayConnectConfig?.effectiveStableID
?? self.connectedGatewayID,
!GatewayStableIdentifier.matches(currentStableID, stableID)
else { return }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear stale problems when the route was reset

Fresh evidence since the earlier stale-problem thread: setup-link switches call resetGatewaySessionsForTargetSwitch, which clears activeGatewayConnectConfig and connectedGatewayID but leaves lastGatewayProblem; the subsequent manual connect reaches this guard with no currentStableID, so it returns without clearing. In that setup-link/deep-link switch after a prior gateway error, the new problem-over-progress precedence keeps rendering the old gateway’s failure during the replacement connect instead of the new progress. Please either clear retained problems when no current route remains, or carry the previous route ID through the reset so this check can still identify the switch.

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui cli CLI command changes scripts Repository scripts agents Agent runtime and tooling extensions: qa-lab size: XL and removed size: M labels Jul 13, 2026
@steipete
steipete force-pushed the codex/ios-preserve-reconnect-error branch from 43477c9 to 3737912 Compare July 13, 2026 02:52
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed docs Improvements or additions to documentation app: web-ui App: web-ui cli CLI command changes scripts Repository scripts agents Agent runtime and tooling extensions: qa-lab size: XL labels Jul 13, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 13, 2026
@steipete

steipete commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 3efb98d5b4ae34b8897400cf19c9c12b9ff92f58:

  • Behavior: same-target reconnects retain the last gateway error; success, a new failure, or a changed target replaces/clears it.
  • State safety: retained display history cannot pause a fresh retry; a currently active operator approval remains visible and owner-controlled when the node loop reports cancellation.
  • Focused simulator result: GatewayReconnectErrorRetentionTests passed 2/2 tests in 1 suite. Result bundle: /tmp/openclaw-ios-105875-retention-suite-v2.xcresult.
  • The Xcode build/test, including SwiftFormat and SwiftLint build phases, succeeded.
  • Native inventory is synchronized (changed=false), and git diff --check passed.
  • Fresh autoreview is clean: zero accepted/actionable findings; patch correct (0.87).

Proof scope: broad hosted CI intentionally not awaited per maintainer direction. No physical iPhone was attached for source-blind visual proof.

@steipete
steipete force-pushed the codex/ios-preserve-reconnect-error branch 2 times, most recently from 252f85c to 8862da2 Compare July 13, 2026 07:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8862da24c7

ℹ️ 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".

Comment on lines +3700 to +3704
if !preservingGatewayProblem {
// Same-target reconnects keep the prior failure readable until success or a new failure.
// Initial connects and target changes must not inherit another gateway's problem state.
self.operatorGatewayProblem = nil
self.clearGatewayConnectionProblem()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear stale operator problems when no operator loop starts

When a same-stable-ID reconnect changes credentials so shouldStartOperatorGatewayLoop is false (for example a bootstrap/setup-code retry after an operator auth failure), this branch preserves both lastGatewayProblem and the private operatorGatewayProblem. Since no operator loop is started to call clearOperatorGatewayConnectionProblemIfCurrent(), handleNodeGatewayConnected() later calls clearGatewayConnectionProblem() and republishes that stale operator problem, leaving the UI showing the old error after the replacement route succeeds. Preserve the visible problem for in-flight retries, but clear operator-owned state when the new config will not start that owner.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67f853b254

ℹ️ 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".

Comment on lines +3702 to +3706
if !preservingGatewayProblem {
// Same-target reconnects keep the prior failure readable until success or a new failure.
// Initial connects and target changes must not inherit another gateway's problem state.
self.operatorGatewayProblem = nil
self.clearGatewayConnectionProblem()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear operator pause state before retry loops resume

When a same-target retry follows an operator/pairing failure, this preserving path leaves operatorGatewayProblem installed even though gatewayPairingPaused is temporarily cleared. If the node session connects before the operator loop, handleNodeGatewayConnected() calls clearGatewayConnectionProblem(), which republishes that retained operator problem and sets gatewayPairingPaused back to true; the operator loop then stays in gatewayReconnectLoopDelay() instead of checking the now-approved pairing. Fresh path beyond the earlier no-operator-loop case: this can also block retries when the operator loop is present but has not reached its connect attempt yet.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69793bdac7

ℹ️ 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".

Comment on lines +3757 to 3759
// Preflight has not committed the replacement target yet. Keep the readable snapshot
// while retiring live pairing control; the committed route switch clears the snapshot.
self.operatorGatewayProblem = nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear retained errors when TLS preflight fails

Fresh evidence beyond the earlier stale-target comments: manual TLS preflight failures never reach connectToGateway/clearGatewayProblemForCommittedTargetSwitch—GatewayConnectionController.connectManual only writes the probe error to gatewayStatusText and returns. When the user manually connects to a different TLS gateway with no stored fingerprint after a retained error, preserving lastGatewayProblem here makes onboarding/status surfaces keep showing the previous gateway's problem instead of the new probe failure; clear or replace the retained problem on preflight failure or target mismatch.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the codex/ios-preserve-reconnect-error branch from 69793bd to 3efb98d Compare July 13, 2026 09:07
@steipete
steipete merged commit 3261667 into main Jul 13, 2026
93 of 96 checks passed
@steipete
steipete deleted the codex/ios-preserve-reconnect-error branch July 13, 2026 09:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3efb98d5b4

ℹ️ 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".

Comment on lines +3711 to +3714
if !preservingGatewayProblem {
// Same-target reconnects keep the prior failure readable until success or a new failure.
// Initial connects and target changes must not inherit another gateway's problem state.
self.clearGatewayConnectionProblem()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable retained toast actions during reconnects

When a same-target retry or certificate-trust reconnect preserves the prior problem here, the main app toast also remains visible: RootTabs.swift:708-727 renders appModel.lastGatewayProblem with an enabled primary action, and RootTabs.swift:1286-1298 starts trustRotatedGatewayCertificate/connectActiveGateway again with no in-flight guard. In the main app, a user can tap Retry/Review repeatedly during the active reconnect, invalidating and restarting the connection attempt instead of seeing a busy/disabled action; please gate the retained problem action for this non-onboarding toast as well.

Useful? React with 👍 / 👎.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 14, 2026
* fix(ios): keep reconnect errors visible

* fix(ios): clear stale errors on gateway switch

* chore(ios): keep release notes in PR

* fix(ios): reset status when switching gateways

* fix(ios): retain errors through same-target reconnect

* fix(ios): unpause explicit pairing retries

* fix(ios): isolate retained reconnect errors

* chore(i18n): resync rebased native inventory

* fix(ios): separate reconnect display state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L 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