Skip to content

[codex] Fix Lark v2 card schema#419

Merged
eanzhao merged 1 commit intodevfrom
fix/2026-04-25_lark-v2-card-schema
Apr 25, 2026
Merged

[codex] Fix Lark v2 card schema#419
eanzhao merged 1 commit intodevfrom
fix/2026-04-25_lark-v2-card-schema

Conversation

@eanzhao
Copy link
Copy Markdown
Contributor

@eanzhao eanzhao commented Apr 25, 2026

Problem and solution

Fixes #416.

Lark schema 2.0 interactive cards require renderable card blocks under body.elements. The standard LarkMessageComposer interactive-card path still emitted elements at the root, producing a hybrid v1/v2 payload that NyxID forwards to Lark and can fail with a 502 for /agents and other card-only replies.

This PR changes the standard interactive-card branch to emit body.elements, matching the existing form-mode branch and Lark v2 shape.

Impact paths

  • agents/platforms/Aevatar.GAgents.Platform.Lark/LarkMessageComposer.cs
  • test/Aevatar.GAgents.Platform.Lark.Tests/LarkMessageComposerTests.cs

NyxID cross-check

Checked the local NyxID repository at ~/Code/NyxID:

  • backend/src/services/channel_adapters/lark.rs passes reply.metadata.card through as the interactive Lark content string.
  • The send path posts that content to /open-apis/im/v1/messages with msg_type = "interactive".
  • Existing NyxID card body tests still cover the older root-level elements shape, so this repository needs to produce the valid Lark v2 body.elements payload before handing it to NyxID.

No NyxID code change is included in this PR; the issue's timeout/schema-validation hardening remains a separate defense-in-depth follow-up.

Validation

  • dotnet test test/Aevatar.GAgents.Platform.Lark.Tests/Aevatar.GAgents.Platform.Lark.Tests.csproj --nologo - passed, 13 tests
  • dotnet test test/Aevatar.GAgents.ChannelRuntime.Tests/Aevatar.GAgents.ChannelRuntime.Tests.csproj --nologo - passed, 421 tests
  • bash tools/ci/test_stability_guards.sh - passed
  • git diff --check - passed

Docs

No architecture or user-facing documentation changes were needed.

@eanzhao eanzhao marked this pull request as ready for review April 25, 2026 13:14
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.37%. Comparing base (f5cc284) to head (87568b6).
⚠️ Report is 2 commits behind head on dev.

@@            Coverage Diff             @@
##              dev     #419      +/-   ##
==========================================
- Coverage   70.38%   70.37%   -0.01%     
==========================================
  Files        1175     1175              
  Lines       84453    84453              
  Branches    11124    11124              
==========================================
- Hits        59440    59438       -2     
- Misses      20721    20723       +2     
  Partials     4292     4292              
Flag Coverage Δ
ci 70.37% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file 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 eanzhao merged commit baa028c into dev Apr 25, 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.

fix(lark): malformed v2 card schema causes nyx-api 502, /agents silently drops reply

1 participant