feat: display model name in Feishu card footer#199
Open
qianhaizhang wants to merge 2 commits intolarksuite:mainfrom
Open
feat: display model name in Feishu card footer#199qianhaizhang wants to merge 2 commits intolarksuite:mainfrom
qianhaizhang wants to merge 2 commits intolarksuite:mainfrom
Conversation
Add support for displaying the selected model name in the Feishu message card footer. Users can enable this via the footer.model configuration option. - Add model field to FeishuFooterConfig type - Update default footer config with model: false - Pass model info from onModelSelected callback to StreamingCardController - Render model name in card footer when enabled - Filter models ending with "off" from display (e.g., "claude-sonnet-4-6-off") - Display provider in format: provider/model (e.g., "anthropic/claude-sonnet-4-6") - Show thinkLevel as suffix when not "off" (e.g., "model (extended)") Example display: - Chinese: 已完成 · 耗时 12.3s · anthropic/claude-sonnet-4-6 - English: Completed · Elapsed 12.3s · anthropic/claude-sonnet-4-6 Configuration: openclaw config set channels.feishu.footer.model true Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 30 unit tests covering all 8 combinations of footer elements: - Happy path: model display with/without provider, thinkLevel filtering - Edge cases: all 8 combinations of status/elapsed/model toggles - Error and aborted states with model display - Fix bug: model parameter not passed to buildCompleteCard - Fix bug: thinkLevel "off" still displayed as suffix Footer combinations covered: ✓ status + elapsed + model ✓ status + elapsed ✓ status + model ✓ elapsed + model ✓ status only ✓ elapsed only ✓ model only ✓ all disabled Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HanShaoshuai-k
requested changes
Mar 21, 2026
Collaborator
HanShaoshuai-k
left a comment
There was a problem hiding this comment.
Nice feature! The test coverage is solid and the default-off behavior is a good design choice. A few things to address:
Must Fix:
reply-dispatcher.ts L305-L320: The onModelSelectedWrapper breaks the original callback semantics — when ctx is undefined, prefixContext.onModelSelected is never called, which may break prefix context state reset. The forward should be unconditional:
const onModelSelectedWrapper = (
ctx: { provider: string; model: string; thinkLevel: string | undefined } | undefined,
) => {
if (ctx && controller) {
controller.setModel(ctx);
}
prefixContext.onModelSelected(ctx);
};Should Fix:
- The model type
{ provider: string; model: string; thinkLevel?: string }is duplicated inline in 4+ places. Consider extracting a sharedModelInfointerface insrc/core/types.ts. - Missing
vitest.config.ts— the PR adds vitest as a dependency but no config file.vitest runmay not behave as expected without it. provideris typed as requiredstringbut tests pass objects without it (e.g.{ model: 'claude-haiku-4-5' }). Should beprovider?: string.
Minor:
- Missing newline at end of
footer-model.test.ts setModeltests only assertexpect(controller).toBeDefined()— not very meaningful
Question: The "filter models ending with off" logic relies on SDK internal naming conventions. Is this a stable contract, or would it be safer to rely solely on the thinkLevel field?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for displaying the AI model name in the Feishu card footer. This feature allows users to see which model (including provider and think mode) was used to generate responses directly in the Feishu message card.
Changes
footer.modelconfig option to enable/disable model displayprovider/model(e.g., "anthropic/claude-sonnet-4-6")Files Changed
src/card/builder.ts- Main footer rendering logicsrc/card/reply-dispatcher.ts- Pass model info to controllersrc/card/streaming-card-controller.ts- Handle model selectionsrc/core/config-schema.ts- Config schema updatesrc/core/footer-config.ts- Footer config typesrc/card/__tests__/footer-model.test.ts- 30 unit testsTest plan
footer.modeldisabled (should not show model)🤖 Generated with Claude Code