Description
The built-in GroupChatContext ignores group messages that contain only a Json component. This is common for QQ share cards (for example, Xiaohongshu links). As a result, a later reaction such as "wow" reaches the LLM without the shared card in its group context.
The aiocqhttp adapter preserves the OneBot json segment as a Json component, but Main.on_message() only forwards Plain and Image messages to GroupChatContext, and _format_message() has no Json branch.
Steps to reproduce
- Enable built-in group context awareness for an aiocqhttp group.
- Send a QQ share card whose OneBot message contains only a
json segment.
- Send a short follow-up message that refers to the card.
- Inspect the group context attached to the LLM request.
Actual behavior
The event bus receives the card as [ComponentType.Json], but the card is absent from the group context. The LLM only sees the short follow-up and older messages.
Example log sequence:
[10:49:06] user: [ComponentType.Json]
[10:49:55] user: wow
The LLM request created for the follow-up contains no entry for the 10:49 JSON card.
Expected behavior
JSON share cards should be recorded as a compact, readable context entry using common QQ card metadata such as title, description, and target URL. Unknown card formats should retain a generic placeholder rather than exposing the complete raw payload.
Environment
- AstrBot v4.27.3
- aiocqhttp / OneBot v11
- NapCat
Description
The built-in
GroupChatContextignores group messages that contain only aJsoncomponent. This is common for QQ share cards (for example, Xiaohongshu links). As a result, a later reaction such as "wow" reaches the LLM without the shared card in its group context.The aiocqhttp adapter preserves the OneBot
jsonsegment as aJsoncomponent, butMain.on_message()only forwardsPlainandImagemessages toGroupChatContext, and_format_message()has noJsonbranch.Steps to reproduce
jsonsegment.Actual behavior
The event bus receives the card as
[ComponentType.Json], but the card is absent from the group context. The LLM only sees the short follow-up and older messages.Example log sequence:
The LLM request created for the follow-up contains no entry for the 10:49 JSON card.
Expected behavior
JSON share cards should be recorded as a compact, readable context entry using common QQ card metadata such as title, description, and target URL. Unknown card formats should retain a generic placeholder rather than exposing the complete raw payload.
Environment