microsoft / microsoft/foundry-local
[P0][Telemetry regression] Restore record_host_exception in current Android Core binaries
- Dominant language
- C++
- Stars
- 2.6k
- Forks
- 369
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 39
Description
## Description
The current Android Core v1.2.4 binary rejects the host-error telemetry command used by the Android service:
```text
Executing command: 'record_host_exception'
Unknown command: record_host_exception
Host telemetry disabled for this process: RuntimeException: Unknown command
```
This prevents SDK-originated failures from reaching the Kusto `error` table even though the Android SDK successfully captures, buffers, parcels, and sends them across AIDL to the service.
## Impact
microsoft/Foundry-Local-for-Android#723 adds release/runtime attribution to SDK-originated errors. Exact-commit real-device validation proved the Android path carries:
- `foundry_ipc_sdk_version=0.1.6`
- `foundry_service_version_name=0.1.6`
- `foundry_ort_package_version=1.26.0`
- `foundry_genai_native_build_version=0.14.1`
The SDK buffer changed from one queued event to zero only after `IFoundryLocalManager.recordHostExceptions(...)` returned, and the service reached JNI. However, Core rejected `record_host_exception`, so no Kusto `error` row was produced. This also means other Android host exceptions can be silently lost after the service disables host telemetry for the process.
## Regression Evidence
- Android PR #434 / merge `4978e6c5` shipped an arm64 Core binary containing `RecordHostException` and reported end-to-end Kusto validation.
- Android PR #663 / merge `4e8cea06` replaced that binary with Core v1.2.4 while updating ORT/GenAI.
- Current arm64 Core SHA-256: `15F3F19BE5BD30B89599607999AEB23AE88B8E7123C752041B5CB55004D73620`
- Current binary does not contain `RecordHostException` or `HostException` and returns `Unknown command` at runtime.
- Prior telemetry-capable arm64 Core SHA-256: `3A348A7E294633FAEFC8E7D8B647E919CD457B6E8D7776BFA36CF60067602671`
Exact Samsung validation session: `4728d567-9cae-44a8-82a5-d013a5374177`.
Kusto result after bounded polling:
```text
deviceid rows = 1
action rows = 1
error rows = 0
```
## Required Fix
Provide current ABI-matched Android Core binaries that preserve Core v1.2.4 / ORT 1.26.0 / GenAI 0.14.1 compatibility and restore:
- `record_host_exception`
- `RecordExceptionFields`
- successful host-error submission to the configured telemetry backend
Do not require an Android-side bypass, direct backend insertion, or test-only production API.
## Acceptance Criteria
- [ ] `record_host_exception` is recognized by current arm64-v8a and x86_64 Core binaries.
- [ ] `RecordExceptionFields` accepts the Android service payload contract.
- [ ] Unknown/invalid fields fail explicitly without disabling valid subsequent host telemetry.
- [ ] An Android SDK-originated initialization or binding failure reaches the Kusto `error` table.
- [ ] The resulting row preserves all four release/runtime attribution keys from microsoft/Foundry-Local-for-Android#723 without truncation.
- [ ] Automated command-contract coverage prevents future native binary updates from silently dropping this command.
## Scope Boundary
This issue is the native/Core command regression. Binder generation-safe recovery remains microsoft/Foundry-Local-for-Android#720, and tokenizer lifetime crashes remain #1091.
Contributor guide
Research direction
Start by tracing how the current arm64-v8a and x86_64 Core v1.2.4 binaries expose the record_host_exception command and accept RecordExceptionFields. Compare the current and prior telemetry-capable binaries, then run the Android service validation and automated command-contract coverage; done means valid host errors reach Kusto with all four attribution keys and invalid fields fail explicitly without disabling later telemetry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cpp
- Domain
- ai-infra-agents, build-system, mobile
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100