fix(daemon): remember last connected device — empty device_address is no longer fatal#174
Merged
Conversation
… no longer fatal (tincan-97mlk) Root cause of the 2026-07-04→05 outage (18h with no phone bridge, calls without AEC): the GUI's device picker persists device_address="" for its 'Auto-discover (recommended)' choice — but oFono auto-discovery only works while the phone is ALREADY connected. After any disconnect that's a chicken-and-egg trap: no address → cannot proactively connect the phone → no HFP modem → discovery finds nothing → daemon retries '' forever. Restart storms re-read the wiped INI each time. - TincanService.Connect now persists bluetooth/last_device_address on every successful session (skip-if-unchanged; best-effort) - _resolve_device_address gains step 5: fall back to that last-known address when explicit config is empty and discovery fails - Auto-discover keeps its semantics (fresh discovery still wins when the phone is connected); it just can't strand the daemon anymore Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause of the 18-hour phone-bridge outage (and the 'AEC stopped working' reports — calls had no managed audio path at all): the GUI's 'Auto-discover (recommended)' picker choice persists
device_address="", and oFono auto-discovery only works while the phone is already connected. After any disconnect: no address → can't proactively connect the phone → no modem → discovery finds nothing → retry''forever. Overnight restart storms re-read the wiped INI each time.Fix — a one-way ratchet:
TincanService.Connectpersistsbluetooth/last_device_addresson every successful session;_resolve_device_addressfalls back to it when explicit config is empty and discovery fails. Auto-discover keeps its semantics (fresh discovery still wins when the phone is connected) — it just can't strand the daemon anymore.Suite green (2,416). Machine already recovered by hand (INI restored, reconnected); this makes the recovery automatic next time.
🤖 Generated with Claude Code