Move Node telemetry consent to mxc_ffi - #1251
Merged
Branden Bonaby (bbonaby) merged 11 commits intoSep 24, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Identify the synchronous host-service boundary at the file introduction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Explain the thread split and keep native symbol names out of user-facing failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Restore a presenter-aware native request deadline, terminate stalled workers, cover worker failure paths, and correct native diagnostic documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Fail closed before committing expired presenter decisions, abandon timed-out native workers without holding process exit, preserve typed withdrawal failures, and align telemetry documentation and tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Branden Bonaby (bbonaby)
September 23, 2026 21:43
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Worker timeout races and the non-Windows locale behavior regression must be resolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
What changed in this PR
Moves Node telemetry consent from executor processes to direct mxc_ffi bindings while preserving asynchronous presentation and typed errors.
Changes:
- Adds native telemetry bindings and worker-based consent presentation.
- Updates error mapping, tests, documentation, and test configuration.
- Removes obsolete executor-protocol coverage.
| File | Description |
|---|---|
sdk/node/tests/unit/telemetry.test.ts |
Updates public telemetry tests. |
sdk/node/tests/unit/telemetry-request-worker.test.ts |
Tests worker lifecycle and timeouts. |
sdk/node/tests/unit/default-consent-protocol-runner.test.ts |
Removes obsolete protocol tests. |
sdk/node/tests/unit/binding-run.test.ts |
Extends native status mapping coverage. |
sdk/node/src/telemetry.ts |
Uses direct native telemetry operations. |
sdk/node/src/bindings/telemetry.ts |
Defines telemetry FFI bindings. |
sdk/node/src/bindings/telemetry-request-worker.ts |
Coordinates presenters, deadlines, and worker lifecycle. |
sdk/node/src/bindings/telemetry-request-worker-entry.ts |
Executes blocking native consent requests. |
sdk/node/src/bindings/native-error.ts |
Maps telemetry FFI statuses. |
sdk/node/README.md |
Documents updated telemetry behavior. |
sdk/node/package.json |
Registers the worker test suite. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| 100: 'malformed_request', | ||
| 101: 'malformed_request', | ||
| 102: 'backend_error', | ||
| 103: 'backend_error', |
Return notApplicable before locale validation on unsupported platforms and update the telemetry parity checker for Node's removal of private executor-protocol results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Copilot started reviewing on behalf of
Branden Bonaby (bbonaby)
September 23, 2026 22:11
View session
Jeff Whiteside (jsidewhite)
approved these changes
Sep 24, 2026
Branden Bonaby (bbonaby)
deleted the
user/bbonaby/node-native-telemetry
branch
September 24, 2026 00:25
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.

📖 Description
Goal
Replace the Node SDK's telemetry executor protocol with direct, in-process
mxc_fficalls while preserving the existing public consent API, asynchronouspresenter behavior, fail-closed policy handling, and typed native errors.
The implementation:
mxc_telemetry_get_consent_statusmxc_telemetry_withdraw_consentmxc_telemetry_request_consentpresenter callback is synchronous while the JavaScript presenter may be
asynchronous
SharedArrayBufferandAtomics.wait/Atomics.notifypresenter is deciding
keep Node alive
MxcErrordetails, including the native FFI statusflowchart LR A[Node telemetry API] --> B{Operation} B -->|query| C[Async native binding] B -->|withdraw| C C --> D[mxc_ffi telemetry APIs] B -->|request consent| E[Telemetry request worker] E --> F[mxc_telemetry_request_consent] F -->|synchronous prompt callback| E E -->|present message| G[Main-thread JS presenter] G -->|decision| H[SharedArrayBuffer + Atomics] H --> E E --> F D --> I[Native consent and policy implementation] F --> IThe native layer remains authoritative for consent persistence, administrative
policy, prompt content, and consent transitions. The Node SDK owns JavaScript
presentation, public result parsing, cancellation, and worker lifecycle.
Current limitations
routed through an SDK-owned
console.warnchannel.when termination is requested. The worker is unreferenced on timeout so it
cannot keep the Node process alive.
APIs.
🔗 References
🔍 Validation
tests passed.
git diff --checkpassed.its
@microsoft/mxc-sdkpackage alias was unresolved; the resulting errorswere not specific to the telemetry change.
✅ Checklist
Cargo.lock, thedependency-feed-checkcheck passes (see docs/pull-requests.md)📋 Issue Type
GitHub Actions runs the PR validation build automatically. The ADO pipeline
(
MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity withthe GitHub Actions build; it runs on merge to
main, and Microsoft reviewerswith write access can trigger it on a PR with
/azp run. Seedocs/pull-requests.md.
If the
dependency-feed-checkcheck fails on a new dependency, the crate mustbe added to the feed before the PR can pass. See
docs/pull-requests.md
for the steps.
Microsoft Reviewers: Open in CodeFlow