COR-6360: support AI Data consent - #77
Open
tungntEmotiv wants to merge 2 commits into
Open
Conversation
tungntEmotiv
requested review from
QuyetThangNguyen,
sondhemotiv and
thamha-emotiv
and
a lite review from Copilot
August 14, 2026 08:47
|
The issue is ready for review, and the below acceptance criteria have been met:
Code Reviewer could not determine whether the following acceptance criteria have been met:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class support for the “AI Data consent” feature to the Unity plugin by introducing a consent model and exposing new Cortex request/response flows through the public Unity-facing interfaces.
Changes:
- Introduces
AIDataConsentmodel to represent consent state and policy URL. - Adds
getAiDataConsent/setAiDataConsentrequest methods and response events inCortexClient. - Exposes async
GetAIDataConsent/SetAIDataConsentAPIs viaAuthorizer,EmotivUnityItf, andBCIGameItf.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Src/Types.cs | Adds AIDataConsent data model for parsing Cortex consent payloads. |
| Src/CortexClient.cs | Adds consent events + response handling + request methods for Cortex consent APIs. |
| Src/Authorizer.cs | Adds async Task-based wrappers around the new consent APIs. |
| Src/EmotivUnityItf.cs | Exposes consent APIs on the Unity interface. |
| Src/BCIGameItf.cs | Exposes consent APIs on the game-facing interface and documents them. |
Suppressed comments (2)
Src/Authorizer.cs:234
- OnGetAiDataConsentDone logs consent.Accepted without null checks and never clears _getAiDataConsentTcs. If consent is null, logging will throw; and keeping the TCS reference around can cause later calls to incorrectly reuse/combine results.
private void OnGetAiDataConsentDone(object sender, AIDataConsent consent)
{
UnityEngine.Debug.Log("OnGetAiDataConsentDone: " + consent.Accepted);
_getAiDataConsentTcs?.TrySetResult(consent);
}
Src/Authorizer.cs:252
- OnSetAiDataConsentDone logs consent.Accepted without null checks and never clears _setAiDataConsentTcs. If consent is null, logging will throw; and keeping the TCS reference around can affect subsequent calls.
private void OnSetAiDataConsentDone(object sender, AIDataConsent consent)
{
UnityEngine.Debug.Log("OnSetAiDataConsentDone: " + consent.Accepted);
_setAiDataConsentTcs?.TrySetResult(consent);
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
The PR to support AI Data consent feature.
Please help to review. Thanks
Rovo Dev code review: Rovo Dev has reviewed this pull request
Any suggestions or improvements have been posted as pull request comments.