Skip to content

fix: avoid BLE reconnect race when Agent owns device - #49

Draft
sunflower-zzn wants to merge 1 commit into
AhakeyAI:mainfrom
sunflower-zzn:codex/fix-agent-ble-ownership-race
Draft

fix: avoid BLE reconnect race when Agent owns device#49
sunflower-zzn wants to merge 1 commit into
AhakeyAI:mainfrom
sunflower-zzn:codex/fix-agent-ble-ownership-race

Conversation

@sunflower-zzn

Copy link
Copy Markdown

Summary

  • prevent the App BLE manager from scanning or reconnecting while ahakeyconfig-agent owns the keyboard
  • expose the Agent's current peripheral name, UUID, and GATT readiness through its status socket reply
  • render Agent-owned BLE state in the device information view instead of stale App-manager state

Root cause

The App BLE manager remained capable of reconnecting after ownership had moved to the Agent. Its cached state could therefore show an old device name and repeated connection failures while the Agent already held the GATT connection.

Validation

  • swiftc -parse passed for all changed Swift sources and the new focused tests
  • git diff --check passed
  • swift test could not run locally because the installed Command Line Tools compiler does not match the macOS SDK, and full Xcode is unavailable

@sunflower-zzn
sunflower-zzn force-pushed the codex/fix-agent-ble-ownership-race branch from 036a62b to 2f5d0b6 Compare August 11, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant