fix(tray): unify wearable client on repo-root .env + fix pendant Opus load - #344
Merged
Conversation
… load
The unified tray's pendant (BLE) path streamed to localhost and crashed on
launch, so `chronicle-tray install --pendant` produced a login item that never
stayed up.
- clients.py: the pendant extra decodes Opus via opuslib, which finds native
libopus through ctypes.util.find_library("opus") — a search that skips
Homebrew's lib dir, and launchd hands the agent a bare environment. Add
DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib:/usr/local/lib to the generated
macOS plist when the pendant extra is enabled.
- local-wearable-client/backend_sender.py, main.py: read the unified
repository-root .env (BACKEND_URL / AUTH_USERNAME / AUTH_PASSWORD) that the
tray and vault sync already use, mirroring vault_core. backend_sender now
passes BACKEND_URL to resolve_backend_url (it previously passed None, so an
explicit server URL was ignored and it fell back to localhost) and accepts
AUTH_* auth keys, with the legacy BACKEND_HOST / ADMIN_* names kept as
fallbacks.
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What
Fixes the unified tray's
--pendantinstall, which produced a login item that streamed tolocalhostand crash-looped on launch.clients.py— pendant Opus native libThe pendant (BLE) path decodes Opus via
opuslib, which loads nativelibopusthroughctypes.util.find_library("opus"). That search skips Homebrew's lib dir, and launchd hands the agent a bare environment — so the tray crashed with "Could not find Opus library". Now the generated macOS plist getsDYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib:/usr/local/libwhen the pendant extra is enabled (harmless when the dirs are absent).local-wearable-client/{backend_sender,main}.py— unified configThe wearable client didn't read the repository-root
.envthe way the tray and vault sync do:backend_sender._resolve_backend_url()calledresolve_backend_url(None), so an explicitBACKEND_URLwas ignored and it fell back tolocalhost. It also only readBACKEND_HOSTandADMIN_*auth keys.load_dotenv(REPO_ROOT / ".env")and read the unifiedBACKEND_URL/AUTH_USERNAME/AUTH_PASSWORDkeys (mirroringvault_core), with legacyBACKEND_HOST/ADMIN_*names kept as fallbacks.Verification
On this Mac,
chronicle-tray install --pendantnow installs a login item that stays up:vault_core: Backend URL set explicitly: http://<server>:8000backend_sender: Wearable backend resolved: http://<server>:8000 (ws: ws://<server>:8000/ws?codec=opus)(waslocalhost)ble_manager: Scan found N device(s)— pendant section loads, no Opus crash.