Skip to content

fix(ios): harden Talk voice-session lifecycle from review - #111424

Merged
steipete merged 1 commit into
mainfrom
fix/ios-voice-session-lifecycle
Jul 19, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/ios-voice-session-lifecycle

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Follow-up to the merged iOS voice-session adoption (#111369), addressing four review findings on the Talk realtime lifecycle.

Why This Change Was Made

  1. Close/clear the adopted voice session when a prefetch is invalidated. A connection-time realtime prefetch adopts its voiceSessionId (and creates a server-side voice session) before any live transport exists. On a config/provider change, reloadConfig and the Talk-disable path previously cleared only prefetchedRealtimeSession, leaving activeRealtimeVoiceSessionId set — so the next talk.client.create sent the stale id with a possibly-new provider, and the gateway rejects resuming a voice session under a different provider (createOrResumeClientVoiceSession throws "voice session provider does not match"), breaking direct realtime until the session was closed. Both invalidation points now route through invalidatePrefetchedRealtimeSession(), which closes+clears the adopted session when no live call is active and preserves an in-progress direct call otherwise.
  2. Retry logical closes. talk.client.close failures were logged after state was already cleared, with no retry, orphaning the gateway session until the 6h stale sweep and delaying the mutation digest. Closes now retry (0/500/2000ms), matching the web client.
  3. Surface exhausted transcript-persist failures. When all transcript retries failed, the queue completed silently. This is critical for confirmation: a dropped post-challenge affirmation transcript means the spoken "yes" is never durably recorded, so the gateway can't authorize the follow-up action. The failure now surfaces through the session delegate (the manager shows the existing localized error status) instead of continuing silently; the queue still processes later entries.
  4. Localize the "Confirmation needed" status. The status token bypassed the presentation switches, so non-English installs showed verbatim English despite shipped translations. Both presentationText/watchPresentation switches now localize it; its native locale translations are added.

User Impact

  • Changing the Talk realtime provider/config after a prefetch no longer breaks the next voice call.
  • Transient close failures self-heal instead of leaving an orphaned session.
  • A failed affirmation transcript is surfaced rather than silently blocking spoken confirmation.
  • The confirmation-needed status is localized.

Evidence

  • Build green via the project's real flow (xcodegen generate → xcodebuild, iPhone simulator, Xcode 27 beta, no signing): ** BUILD SUCCEEDED **.
  • Talk tests: TalkModeManagerTests (55) + TalkRealtimeTranscriptWriteQueueTests (2) → 57 pass, zero failures, including new regressions: config-invalidation closes+clears an adopted prefetch, config-invalidation preserves a live call, close retries three times, and transcript exhaustion surfaces to the delegate.
  • pnpm native:i18n:check exit 0 (entries=4961); locale artifacts consistent.
  • git diff --check clean; rebased current on main. apps/ios + apps/.i18n only.

- Close+clear the adopted logical voice session when a config/provider change
  invalidates a realtime prefetch (a live call is preserved); prevents the
  gateway rejecting a stale voiceSessionId resume under a new provider.
- Retry talk.client.close (0/500/2000ms) before forgetting the session, matching
  the web client, so a transient close does not orphan it until the 6h sweep.
- Surface exhausted transcript-persist failures through the session delegate so a
  dropped affirmation transcript no longer silently blocks spoken confirmation.
- Localize the "Confirmation needed" status through the presentation switches;
  add its native locale translations.
@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios size: L maintainer Maintainer-authored PR labels Jul 19, 2026
@steipete
steipete merged commit da534dc into main Jul 19, 2026
113 of 118 checks passed
@steipete
steipete deleted the fix/ios-voice-session-lifecycle branch July 19, 2026 14:01
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 20, 2026
…11424)

- Close+clear the adopted logical voice session when a config/provider change
  invalidates a realtime prefetch (a live call is preserved); prevents the
  gateway rejecting a stale voiceSessionId resume under a new provider.
- Retry talk.client.close (0/500/2000ms) before forgetting the session, matching
  the web client, so a transient close does not orphan it until the 6h sweep.
- Surface exhausted transcript-persist failures through the session delegate so a
  dropped affirmation transcript no longer silently blocks spoken confirmation.
- Localize the "Confirmation needed" status through the presentation switches;
  add its native locale translations.
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…11424)

- Close+clear the adopted logical voice session when a config/provider change
  invalidates a realtime prefetch (a live call is preserved); prevents the
  gateway rejecting a stale voiceSessionId resume under a new provider.
- Retry talk.client.close (0/500/2000ms) before forgetting the session, matching
  the web client, so a transient close does not orphan it until the 6h sweep.
- Surface exhausted transcript-persist failures through the session delegate so a
  dropped affirmation transcript no longer silently blocks spoken confirmation.
- Localize the "Confirmation needed" status through the presentation switches;
  add its native locale translations.
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 size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant