Skip to content

Fallback Nyx registration lookup to bounded scan#360

Merged
eanzhao merged 7 commits into
devfrom
fix/2026-04-24_lark-nyx-registration-query-fallback
Apr 24, 2026
Merged

Fallback Nyx registration lookup to bounded scan#360
eanzhao merged 7 commits into
devfrom
fix/2026-04-24_lark-nyx-registration-query-fallback

Conversation

@eanzhao
Copy link
Copy Markdown
Contributor

@eanzhao eanzhao commented Apr 23, 2026

Problem

Lark relay traffic can still reach Aevatar, but the reply path can stop before Nyx receives /api/v1/channel-relay/reply.

Two observable issues are covered in this branch:

  • the channel runtime may miss the local registration by nyx_agent_api_key_id even when the same registration is visible via GET /api/channels/registrations
  • when relay ingress authentication fails, the logs do not currently expose enough information to tell whether the miss is caused by the registration lookup, the stored relay credential, or the callback headers

Solution

  • keep ChannelBotRegistrationQueryPort on the original exact-match projection query path
  • move the bounded registration scan into ChannelConversationTurnRunner
  • only enable that scan for confirmed Nyx relay turns after an exact nyx_agent_api_key_id miss
  • preserve the normal O(1) miss path for non-relay / malformed identity lookups
  • add structured Nyx relay signature diagnostics in NyxIdRelayAuthValidator

Impact

  • ChannelConversationTurnRunner
  • ChannelBotRegistrationQueryPort
  • NyxIdRelayAuthValidator
  • ChannelConversationTurnRunnerTests
  • RegistrationQueryPortTests
  • NyxIdRelayAuthValidatorTests

Validation

  • dotnet test test/Aevatar.GAgents.ChannelRuntime.Tests/Aevatar.GAgents.ChannelRuntime.Tests.csproj --nologo --filter "FullyQualifiedName~RegistrationQueryPortTests|FullyQualifiedName~ChannelConversationTurnRunnerTests|FullyQualifiedName~NyxIdRelayTransportTests"
  • dotnet test test/Aevatar.AI.Tests/Aevatar.AI.Tests.csproj --nologo --filter "FullyQualifiedName~NyxIdRelayAuthValidatorTests|FullyQualifiedName~NyxIdChatEndpointsCoverageTests"
  • bash tools/ci/test_stability_guards.sh

@eanzhao eanzhao marked this pull request as ready for review April 23, 2026 18:41
Copy link
Copy Markdown

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

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: fe4b2da93b

ℹ️ 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".

Comment thread agents/Aevatar.GAgents.ChannelRuntime/ChannelBotRegistrationQueryPort.cs Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.04%. Comparing base (860bb93) to head (fbc0d6d).
⚠️ Report is 8 commits behind head on dev.

@@            Coverage Diff             @@
##              dev     #360      +/-   ##
==========================================
- Coverage   70.04%   70.04%   -0.01%     
==========================================
  Files        1155     1155              
  Lines       82584    82584              
  Branches    10868    10868              
==========================================
- Hits        57847    57845       -2     
- Misses      20559    20560       +1     
- Partials     4178     4179       +1     
Flag Coverage Δ
ci 70.04% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 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.

eanzhao and others added 6 commits April 24, 2026 10:14
Add regression coverage for registration lookup, transport parsing,
credential resolution, outbound delivery, and the deferred LLM reply
inbox so the failure modes that could silently swallow Lark relay
traffic are now pinned:

- turn runner: duplicate registrations in bounded scan, scan miss falls
  through to Bot.Value lookup, scan skipped when OutboundDelivery absent
- outbound port: missing reply_message_id, missing platform, empty
  rendered text, Nyx rejecting the relay reply
- transport: reply_token propagation, conversation identity fallback
  chain (conversation.id -> platform_id -> sender -> default), ignored
  empty-text payloads
- inbox runtime: generator throws, generator returns empty, malformed
  request with missing activity or target actor id
- credential resolver: missing registration, missing credential_ref,
  whitespace-only api key id, whitespace normalization

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…x-registration-query-fallback

# Conflicts:
#	agents/Aevatar.GAgents.ChannelRuntime/ChannelConversationTurnRunner.cs
@eanzhao eanzhao merged commit 1e6dce9 into dev Apr 24, 2026
12 checks passed
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