-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] 限制历史消息数功能逻辑缺陷 #5154
Comments
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Hello, @1oca1h0st! I'm here to help you with any bugs, questions, or contributions. Let me know how I can assist you! The issue you're encountering is related to the logic for handling the To address this, you may need to adjust the logic in the The relevant code snippet is: const enableHistoryDivider = useAgentStore((s) => {
const config = agentSelectors.currentAgentChatConfig(s);
return (
config.enableHistoryCount &&
historyLength > (config.historyCount ?? 0) &&
config.historyCount === historyLength - index
);
}); You might need to add a specific check for To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
这个与issue #4816 同一个问题 |
📦 部署环境
Docker
📌 软件版本
v1.38.0
💻 系统环境
macOS
🌐 浏览器
Chrome
🐛 问题描述
限制历史消息数功能打开时,设置为0应当是没有上下文,而不是不限制上下文数量。
现在实际上当启用限制功能时,最低为0,代码逻辑在:
lobehub/lobe-chat/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/index.tsx [68:75]
const enableHistoryDivider = useAgentStore((s) => {
const config = agentSelectors.currentAgentChatConfig(s);
return (
config.enableHistoryCount &&
historyLength > (config.historyCount ?? 0) &&
config.historyCount === historyLength - index
);
});
可以看到限制为0时,会始终返回false
📷 复现步骤
启用一个话题时,启用限制历史消息数功能,设置限制为0即可复现
🚦 期望结果
当启用限制历史消息数功能,且限制为0时,限制应当如下:
user: A
AI:B
---结束对话
user:new A
AI: new B
📝 补充信息
No response
The text was updated successfully, but these errors were encountered: