[Communication] PR2: Adds CommsManager and CommsNodes - #213
Conversation
|
🧱 Stack PR · Base of stack Stack Structure:
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new Unity MonoBehaviour IadsCommsAgent (Assets/Scripts/IADS/IadsCommsAgent.cs) implementing IAgent as a comms-only mailbox proxy. It exposes serialized references and kinematic fields, property mappings (Position/Transform, Speed, orientation vectors, InverseRotation), ElapsedTime access via SimManager, an idempotent Terminate() with OnTerminated, and many IAgent methods that throw NotSupportedException. Also adds messaging primitives (IMessagePayload, Message types, payloads, PendingMessage), EditMode tests validating wiring, termination and PendingMessage validation, and updates to package manifest/lockfile and a regenerated protobuf runtime header. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Assets/Scripts/IADS/IadsCommsAgent.cs`:
- Line 4: Update the class-level comment at the top of IadsCommsAgent.cs (the
comment referring to the IADS Proxy for supporting mailbox message sending and
recieving) to correct the typo by changing "recieving" to "receiving" so the
comment reads "IADS Proxy for supporting mailbox message sending and receiving."
- Around line 21-24: The HierarchicalAgent property may be null when
OnTerminated handlers access it; ensure it cannot be null by initializing
_hierarchicalAgent and guarding accesses: set a safe default in IadsCommsAgent
(e.g., instantiate a new HierarchicalAgent or a lightweight placeholder into the
backing field _hierarchicalAgent), and also add null-checks where OnTerminated
handlers dereference agent.HierarchicalAgent (or bail out early) to avoid race
conditions; update the HierarchicalAgent getter/setter to validate assigned
values (throw or log) so callers cannot set it to null.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2c791cae-aa45-48c9-bc64-d51cb1c61988
📒 Files selected for processing (1)
Assets/Scripts/IADS/IadsCommsAgent.cs
8941186 to
a7438b5
Compare
b0b9526 to
a45b09b
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Assets/Scripts/IADS/IadsCommsAgent.cs`:
- Line 57: Fix the typo in the comment inside IadsCommsAgent (file/class
IadsCommsAgent.cs) — change "Setting ElpasedTime has to be dependent on
SimManager to have uniform clock time." to "Setting ElapsedTime has to be
dependent on SimManager to have uniform clock time." so the comment reads
correctly.
In `@Assets/Tests/EditMode/IadsCommsAgentTests.cs`:
- Around line 71-75: The test currently uses a hard-coded compiler backing field
name in SetSimManagerInstance; instead use the SimManager.Instance property via
reflection: locate the PropertyInfo for "Instance" on typeof(SimManager)
(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic), call
PropertyInfo.SetValue(null, simManager) if a setter exists, and if not present
throw a clear exception indicating the Instance property is read-only so the
test fails with an actionable message; update references to FieldInfo/GetField
to use PropertyInfo/GetProperty and keep method name SetSimManagerInstance and
symbol SimManager.Instance for locating the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7c09a180-3b32-46b3-af37-c58ffb263e43
⛔ Files ignored due to path filters (1)
Assets/Scripts/Generated/Proto/CommunicationConfig.csis excluded by!**/generated/**
📒 Files selected for processing (3)
Assets/Scripts/IADS/IadsCommsAgent.csAssets/Tests/EditMode/IadsCommsAgentTests.csAssets/Tests/EditMode/IadsCommsAgentTests.cs.meta
76316f0 to
ba96985
Compare
| @@ -0,0 +1,7 @@ | |||
| <Solution> | |||
tryuan99
left a comment
There was a problem hiding this comment.
Just two comments on generated files. Everything lgtm
Files Modified:
IadsCommsAgent.cs -> IADS Proxy for supporting mailbox message sending and recieving. Created a proxy that extends IAgent so that Mailbox can support IADS. Mailbox only supports Agents and adding a proxy makes IADS a part of an agent.