Add channel registration local mirror endpoint - #3609
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c45893da3e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var receipt = await registrationCommandFacade.RegisterLocalMirrorAsync( | ||
| new ChannelBotRegisterCommand | ||
| { | ||
| RequestedId = registrationId, |
There was a problem hiding this comment.
Reject registration ID collisions at the actor boundary
When registration_id already belongs to another registration, this dispatches it without any existence or ownership check. ChannelBotRegistrationGAgent.ApplyRegistered matches solely by Id, removes the existing entry, and replaces it with the submitted scope and Nyx identifiers, so an authenticated caller who knows another tenant's ID can overwrite that tenant's authoritative registration; even a benign retry erases actor-owned fields absent from this command, including the workflow-delivery credential, repair state, and inbound timestamp. Enforce owner-preserving uniqueness atomically in the actor rather than relying only on the HTTP scope check.
AGENTS.md reference: AGENTS.md:L82-L84
Useful? React with 👍 / 👎.
| var platform = NormalizeOptional(request.Platform)?.ToLowerInvariant(); | ||
| if (platform is null) | ||
| return Results.BadRequest(new { error = "platform is required" }); |
There was a problem hiding this comment.
Reject unsupported platforms before returning 202
For any nonempty platform other than lark or telegram, this validation passes and the endpoint later returns an accepted receipt, but ChannelBotRegistrationGAgent.HandleRegister explicitly ignores unsupported platforms without persisting a registration. A request such as {"platform":"discord", ...} therefore receives 202 while its mirror can never appear; validate against the supported production platform set or surface the asynchronous rejection.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## feature/integrate #3609 +/- ##
=====================================================
- Coverage 83.45% 83.43% -0.03%
=====================================================
Files 1709 1709
Lines 197728 197728
Branches 23735 23735
=====================================================
- Hits 165016 164968 -48
- Misses 21670 21722 +52
+ Partials 11042 11038 -4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Scope
/api/channels/registrations/local-mirrorendpoint to mirror existing NyxID route/key/bot facts into local channel registration state.ChannelBotRegisterCommandthrough the channel registration command facade without provisioning or mutating NyxID remote resources.Verification
dotnet test test/Aevatar.GAgents.ChannelRuntime.Tests/Aevatar.GAgents.ChannelRuntime.Tests.csproj --nologo --filter FullyQualifiedName~ChannelCallbackEndpointsTestspassed: 51 passed, 0 failed./api/v1/channel-relay/replysend after mirroring registration facts.Notes
finalToolCount=0during relay testing was traced to missing local sender binding/OAuth client bootstrap state, not the registration mirror or profile catalog.Generated with Claude Code.