Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 448c251faa
ℹ️ 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".
| if (registrationId is null && apiKeyId is null && !selection.Force && candidates.Length != 1) | ||
| { |
There was a problem hiding this comment.
Gate single-candidate backfill behind explicit selector
The backfill path auto-repairs whenever there is exactly one empty-scope registration, even if the caller did not provide registration_id/nyx_agent_api_key_id. In that case the record is reassigned to the caller’s resolved scope_id without any ownership proof, so a manual rebuild from another tenant can silently claim an orphaned registration. The current guard only blocks multi-candidate bulk updates; it does not protect the single-candidate case.
Useful? React with 👍 / 👎.
| catch (JsonException ex) | ||
| { | ||
| logger.LogWarning(ex, "Invalid channel registration rebuild request payload"); | ||
| return Results.BadRequest(new { error = "Invalid JSON" }); |
There was a problem hiding this comment.
Catch unsupported content types in rebuild request parsing
ReadOptionalRebuildRequestAsync uses ReadFromJsonAsync, which throws InvalidOperationException when Content-Type is not a JSON media type, but HandleRebuildRegistrationsAsync only catches JsonException. A rebuild request sent with a non-JSON body/content-type (for example a common curl -d default) will bubble an unhandled exception instead of returning a controlled client error, turning a recoverable input issue into a server failure path.
Useful? React with 👍 / 👎.
|
Reviewed — the shape is right (reject empty-scope at the edge, provide a backfill path) but the backfill authorization story has a couple of real holes. Posting what I’d want tightened before this goes to prod. P1 —
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## dev #389 +/- ##
==========================================
- Coverage 69.91% 69.90% -0.01%
==========================================
Files 1172 1172
Lines 83456 83456
Branches 10969 10969
==========================================
- Hits 58346 58341 -5
- Misses 20899 20902 +3
- Partials 4211 4213 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
修复看了一遍,P1(跨租户)核心路径已经堵上,整体方向没问题。列几个仍值得收紧的点,都是 Info 级: ✅ 核心安全不变量已成立
Info —
|
Problem
Existing Lark relay registrations can have an empty
scope_id, which prevents relay callbacks from resolving the bot owner's Aevatar scope and applying the owner UserConfig.Solution
scope_id.scope_idfrom the current NyxID request context forchannel_registrationstool calls, so nyxid-chat should not ask the user for it.registration_idornyx_agent_api_key_id, withforcefor deliberate bulk repair.Verification
dotnet test test/Aevatar.GAgents.ChannelRuntime.Tests/Aevatar.GAgents.ChannelRuntime.Tests.csproj --filter "FullyQualifiedName~ChannelBotRegistrationGAgentTests|FullyQualifiedName~ChannelCallbackEndpointsTests|FullyQualifiedName~ChannelRegistrationToolTests|FullyQualifiedName~NyxLarkProvisioningServiceTests" --no-restore --nologobash tools/ci/test_stability_guards.sh