Skip to content

Commit 42e83ea

Browse files
committed
fix(agent): allow explicit BLE helper in auto transport
Summary:\n- Fix CI auto transport verification on non-macOS runners.\n\nDetails:\n- Allow AGENTLIGHT_BLE_HELPER to override the BLE system helper before OS-specific handling.\n- Keep the bundled macOS Bluetooth helper as the default implementation.\n- Preserve the unsupported-platform error when no explicit BLE helper is configured.
1 parent d571373 commit 42e83ea

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

scripts/agentlight

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Environment:
5050
AGENTLIGHT_SERIAL_PORT USB serial port. If empty, auto-detects the first supported port.
5151
AGENTLIGHT_SERIAL_BAUD USB serial baud rate, defaults to 115200
5252
AGENTLIGHT_BLE_DEVICE_NAME BLE device name, defaults to WHALESKY-LABS-AGENTLIGHT
53-
AGENTLIGHT_BLE_HELPER macOS BLE helper executable path.
53+
AGENTLIGHT_BLE_HELPER BLE helper executable override. macOS uses the bundled helper by default.
5454
AGENTLIGHT_HOST Defaults to 192.168.4.1
5555
AGENTLIGHT_BASE_URL Overrides host, for example http://192.168.4.1
5656
AGENTLIGHT_TIMEOUT Curl timeout in seconds, defaults to 2
@@ -247,9 +247,19 @@ PY
247247
fi
248248

249249
if [[ "$transport" == "ble-system" ]]; then
250+
if [[ -n "${AGENTLIGHT_BLE_HELPER:-}" ]]; then
251+
helper="$AGENTLIGHT_BLE_HELPER"
252+
if [[ ! -x "$helper" ]]; then
253+
printf 'AgentLight Bluetooth Helper is not executable: %s\n' "$helper" >&2
254+
exit 2
255+
fi
256+
"$helper" "$command"
257+
exit 0
258+
fi
259+
250260
case "$(uname -s)" in
251261
Darwin)
252-
helper="${AGENTLIGHT_BLE_HELPER:-${script_dir}/../dist/macos/AgentLightBluetoothHelper.app/Contents/MacOS/AgentLightBluetoothHelper}"
262+
helper="${script_dir}/../dist/macos/AgentLightBluetoothHelper.app/Contents/MacOS/AgentLightBluetoothHelper"
253263
if [[ ! -x "$helper" ]]; then
254264
printf 'AgentLight Bluetooth Helper is not built. Run desktop/macos/build-bluetooth-helper.sh first.\n' >&2
255265
exit 2

0 commit comments

Comments
 (0)