Skip to content

✨ feat(prompts): use XML format for topic title generation to improve DeepSeek compatibility#15413

Merged
arvinxx merged 2 commits into
lobehub:canaryfrom
hardy-one:feat/summary-title-xml
Jun 4, 2026
Merged

✨ feat(prompts): use XML format for topic title generation to improve DeepSeek compatibility#15413
arvinxx merged 2 commits into
lobehub:canaryfrom
hardy-one:feat/summary-title-xml

Conversation

@hardy-one

Copy link
Copy Markdown
Contributor

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔗 Related Issue

🔀 Description of Change

DeepSeek V4 Flash/Pro 等模型在生成会话标题时,会忽略 system prompt 的指令,将标题生成任务误认为是对话任务。

使用 XML 结构化 prompt,在 user message 中用 <task> 块明确指令,用 <conversation> 块包裹对话内容,提升模型对指令的遵循率。

🧪 How to Test

  • Tested locally
  • Added/updated tests
  • No tests needed

📸 Screenshots / Videos

Before After
... ...

📝 Additional Information

@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

@hardy-one is attempting to deploy a commit to the LobeHub OSS Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. provider:deepseek labels Jun 2, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@lobehubbot

Copy link
Copy Markdown
Member

@tjx666 - This PR improves DeepSeek model compatibility for topic title generation by switching to XML-structured prompts. Please take a look.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 5710c97618

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/prompts/src/chains/summaryTitle.ts
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.02%. Comparing base (2eb9e34) to head (0c33461).

Additional details and impacted files
@@           Coverage Diff            @@
##           canary   #15413    +/-   ##
========================================
  Coverage   71.02%   71.02%            
========================================
  Files        3212     3212            
  Lines      321285   321290     +5     
  Branches    29240    28292   -948     
========================================
+ Hits       228179   228185     +6     
+ Misses      92931    92929     -2     
- Partials      175      176     +1     
Flag Coverage Δ
app 61.84% <ø> (+<0.01%) ⬆️
database 92.49% <ø> (ø)
packages/agent-runtime 80.48% <ø> (ø)
packages/builtin-tool-lobe-agent 18.52% <ø> (ø)
packages/context-engine 84.17% <ø> (ø)
packages/conversation-flow 91.29% <ø> (ø)
packages/file-loaders 87.89% <ø> (ø)
packages/memory-user-memory 74.99% <ø> (ø)
packages/model-bank 99.99% <ø> (ø)
packages/model-runtime 84.72% <ø> (ø)
packages/prompts 72.51% <94.11%> (+0.01%) ⬆️
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/types 35.36% <ø> (ø)
packages/utils 88.69% <ø> (ø)
packages/web-crawler 88.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 68.43% <ø> (ø)
Services 54.58% <ø> (ø)
Server 72.32% <ø> (+<0.01%) ⬆️
Libs 57.01% <ø> (ø)
Utils 81.44% <ø> (ø)
🚀 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.

@arvinxx arvinxx merged commit 7f3f127 into lobehub:canary Jun 4, 2026
21 of 22 checks passed
@lobehubbot

Copy link
Copy Markdown
Member

❤️ Great PR @hardy-one ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.

This was referenced Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider:deepseek size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants