Skip to content

Add channel registration local mirror endpoint - #3609

Open
louis4li wants to merge 1 commit into
feature/integratefrom
fix/2026-09-09_channel-registration-local-mirror
Open

Add channel registration local mirror endpoint#3609
louis4li wants to merge 1 commit into
feature/integratefrom
fix/2026-09-09_channel-registration-local-mirror

Conversation

@louis4li

@louis4li louis4li commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Scope

  • Add an authenticated /api/channels/registrations/local-mirror endpoint to mirror existing NyxID route/key/bot facts into local channel registration state.
  • Dispatch the existing ChannelBotRegisterCommand through the channel registration command facade without provisioning or mutating NyxID remote resources.
  • Cover endpoint authorization metadata and command dispatch behavior in focused channel runtime tests.

Verification

  • dotnet test test/Aevatar.GAgents.ChannelRuntime.Tests/Aevatar.GAgents.ChannelRuntime.Tests.csproj --nologo --filter FullyQualifiedName~ChannelCallbackEndpointsTests passed: 51 passed, 0 failed.
  • Real local relay callback smoke test reached local registration resolution, LLM reply, and single /api/v1/channel-relay/reply send after mirroring registration facts.

Notes

  • Remaining local finalToolCount=0 during relay testing was traced to missing local sender binding/OAuth client bootstrap state, not the registration mirror or profile catalog.
  • Temporary tunnel callback was restored to the production callback URL after testing.

Generated with Claude Code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@louis4li
louis4li requested a review from jason-aelf as a code owner September 9, 2026 02:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T02:59:37.872509Z c45893d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +213 to +215
var platform = NormalizeOptional(request.Platform)?.ToLowerInvariant();
if (platform is null)
return Results.BadRequest(new { error = "platform is required" });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.43%. Comparing base (358bc70) to head (c45893d).
⚠️ Report is 8 commits behind head on feature/integrate.

@@                  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     
Flag Coverage Δ
ci 83.43% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant