langgenius / langgenius/dify

Knowledge base summary includes model thinking/reasoning tokens in output

Open
#38,587 1 comment 1 reaction 0 assignees View on GitHub
🐞 bug 1.15.0 project#dify
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

### Self Checks

- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
- [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
- [x] I confirm that I am using English to submit this report, otherwise it will be closed.
- [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- [x] Please do not modify this template :) and fill in all the required fields.

### Dify version

1.15.0

### Cloud or Self Hosted

Self Hosted (Docker)

### Steps to reproduce

Use a provider that supports reasoning (qwen3.6:35b)
Create a knowledge base and upload a document
The generated summary includes the model's internal thinking content

### ✔️ Expected Behavior

Only the final summary text should be shown to the user. The reasoning/thinking block should be filtered out.

### ❌ Actual Behavior

The thinking block content is visible in the summary result.

Here's a thinking process:

1. **Analyze User Input:**
- **Input Text:** A Chinese regulatory document excerpt about government credit cards (公务卡). It covers bank responsibilities (points 三, 四), cardholder duties (Article 40), and prohibitions/liabilities for violations (Article 41).
- **Requirements:**
1. Concise summary in plain text.
2. Same language as input (Chinese).
3. Focus on important facts, concepts, details.
4. If images are included, describe key info (none here).
5. Do not use filler words like "好的", "ok", "I understand", "This text discusses", etc.
6. Write directly without extra words.
7. If insufficient content, return empty string (not applicable here).
8. Output only the summary text.
- **Key Information to Extract:**
- Bank/Financial Institution duties: Process applications, maintain systems, provide timely/accurate reimbursement/payment services, negotiate credit limits with budget units, assist with usage/cancellation/loss reporting, provide repayment info.
- Cardholder (staff) responsibilities: Apply under unit organization (except classified tasks), keep card/password safe & bear costs from mishandling, use it for official expenses per regulations, submit to financial monitoring, repay debts promptly, clear debts upon leaving job, comply with laws/regulations.
- Prohibitions & Penalties: Ban on including non-staff,违规报销, leaking private info,违规使用/恶意透支/拖欠/非公务报销, bank data leaks. Violations lead to administrative/criminal liability for responsible persons.
- **Synthesize & Condense (Mental Draft in Chinese):**
银行负责办理公务卡申请、系统维护、信用额度协商及还款反馈,提供规范便捷服务。预算单位工作人员原则上需统一办卡,妥善保管卡片密码,承担保管不善费用;公务支出原则上使用公务卡结算并接受财务监控;及时还款,离职退休需清理债权债务并停用。严禁违规纳入非本单位人员、泄露隐私或公务数据、违规使用、恶意透支、拖欠还款或将私用公款报销。违者追究单位负责人及直接责任人行政责任,涉嫌犯罪者移交司法机关。
- **Check against Requirements:**
1. Concise? Yes, about 3-4 sentences covering all main points.
2. Same language? Chinese. Yes.
3. Focus on important facts? Covers bank duties, staff duties, prohibitions & penalties. Yes.
4. Images? None.
5. No filler words? Checked. Starts directly with content.
6. Direct? Yes.
7. Sufficient content? Yes.
Output matches draft. I will refine it slightly for maximum conciseness and flow while strictly adhering to constraints.
Refined: 银行负责办理公务卡申请、系统维护、信用额度协商及还款信息反馈,提供规范服务。预算单位工作人员原则上统一办卡,须妥善保管卡片密码并承担保管不善费用;公务支出原则上使用公务卡结算并接受财务监控,及时还款,离职退休时清理债权债务并停用。严禁违规纳入非本单位人员、泄露隐私或公务数据、违规使用、恶意透支、拖欠还款及将非公务支出公款报销。违者追究负责人及直接责任人行政责任,涉嫌犯罪者依法移送司法机关。
- **Final Verification:** Matches all constraints. Direct, concise, covers bank duties, staff obligations, prohibitions, and legal consequences. Language is Chinese. No fluff. Ready.✅
银行负责公务卡申请办理、系统维护、信用额度协商及还款信息反馈,提供规范便捷服务。预算单位工作人员原则上须统一办卡,妥善保管卡片与密码并承担保管不善费用;公务支出原则上使用公务卡结算并接受财务监控,及时还款,离职退休时需清理债权债务并停用该卡。严禁违规纳入非本单位人员、泄露持卡隐私或公务数据、违规使用、恶意透支、拖欠还款及将非公务支出公款报销。违者追究单位负责人与直接责任人行政责任,涉嫌犯罪者依法移送司法机关处理。

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in a self-hosted Docker deployment using a reasoning-capable provider such as qwen3.6:35b, then trace the knowledge-base document summary generation path. Verify how the thinking block reaches the summary result and ensure completion means only the final summary text is shown, with the reasoning content filtered out.

Written by the indexing model from the issue text.

Assessment

Domain
ai, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.