Skip to content

fix(lark): emit card v2 callback buttons#422

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

fix(lark): emit card v2 callback buttons#422
eanzhao merged 1 commit intodevfrom
fix/2026-04-25_lark-card-v2-actions

Conversation

@eanzhao
Copy link
Copy Markdown
Contributor

@eanzhao eanzhao commented Apr 25, 2026

Summary

  • Render Lark/Feishu Card JSON 2.0 buttons directly in body.elements instead of the legacy action.actions wrapper.
  • Move button callback payloads from top-level value to behaviors[0].value, matching Card JSON 2.0 while preserving the existing NyxID card.action.trigger parsing contract.
  • Update form card rendering and tests so form inputs/buttons use the same v2 shape.

Root Cause

/agents still produced a hybrid card after PR #419: the card body was moved under body.elements, but buttons kept the older container/value shape. Lark rejected the interactive reply through NyxID with channel-relay/reply -> 502, and the single-use relay token prevented text fallback.

Validation

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

@eanzhao eanzhao marked this pull request as ready for review April 25, 2026 14:42
@eanzhao eanzhao merged commit 6de4e4a into dev Apr 25, 2026
11 checks passed
@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.39%. Comparing base (cf44747) to head (0c27dbc).
⚠️ Report is 2 commits behind head on dev.

@@            Coverage Diff             @@
##              dev     #422      +/-   ##
==========================================
- Coverage   70.39%   70.39%   -0.01%     
==========================================
  Files        1175     1175              
  Lines       84460    84460              
  Branches    11126    11126              
==========================================
- Hits        59456    59452       -4     
- Misses      20714    20718       +4     
  Partials     4290     4290              
Flag Coverage Δ
ci 70.39% <ø> (-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.

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: 0c27dbce95

ℹ️ 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 on lines +295 to +299
if (action.Kind == ActionElementKind.Link && !string.IsNullOrWhiteSpace(action.Value))
{
return new object[]
{
new
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 Keep form buttons from emitting open_url behavior

When a card enters form mode (TextInput present), every non-input action is rendered by BuildFormButton, which always sets form_action_type to submit. This new branch returns an open_url behavior for ActionElementKind.Link, so a link inside a form now gets mixed semantics (submit + open_url), which can prevent the expected callback/form submission flow (or cause card validation rejection) for any workflow that combines text inputs with a link action. Please gate this branch for non-form buttons or suppress form_action_type for link actions.

Useful? React with 👍 / 👎.

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