Skip to content

feat(chat-monitor): 缓存消息增加 mq_text 字段,context 端点返回 MessageQueue 完整文本 - #1316

Merged
This-is-XiaoDeng merged 3 commits into
mainfrom
feat/chat-monitor-mq-message
Jul 30, 2026
Merged

feat(chat-monitor): 缓存消息增加 mq_text 字段,context 端点返回 MessageQueue 完整文本#1316
This-is-XiaoDeng merged 3 commits into
mainfrom
feat/chat-monitor-mq-message

Conversation

@This-is-XiaoDeng

Copy link
Copy Markdown
Member

变更内容

点击用户消息时弹窗显示的是重新拼装的上下文(additional_info 手动组装),与真正投递到 MessageQueue 的版本不一致,内容缺失。

修改

  1. types.py: CachedMessage 增加 mq_text 字段
  2. processor.py: process_messages() 中将投递到 MessageQueue 的完整文本写入 msg_dict["mq_text"]
  3. helpers.py (chat-monitor): serialize_cached_message() 序列化 mq_text
  4. routers/sessions.py (chat-monitor): get_message_context 优先返回 msg.mq_text(含完整 additional_info),旧消息回退到手动构建格式

效果

点击用户消息时,modal 显示的是实际投递给 AI 的完整文本(含 Jinja2 模板渲染的 additional_info),而不是后端手动拼装的简化版。

关联 PR

  • 前端: Moonlark-Dev/chat-monitor(main,已推)

@github-actions
github-actions Bot requested review from montmorill and xxtg666 July 29, 2026 08:06
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@This-is-XiaoDeng
This-is-XiaoDeng merged commit 57d6c95 into main Jul 30, 2026
4 checks passed
@This-is-XiaoDeng
This-is-XiaoDeng deleted the feat/chat-monitor-mq-message branch July 30, 2026 06:55
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.

2 participants