Skip to content

fix: 解决了 Langfuse 标题模型和 DeepSeek EOF 问题#1296

Open
GggggitHub wants to merge 1 commit into
Tencent:mainfrom
GggggitHub:fix/langfuse-title-deepseek-eof
Open

fix: 解决了 Langfuse 标题模型和 DeepSeek EOF 问题#1296
GggggitHub wants to merge 1 commit into
Tencent:mainfrom
GggggitHub:fix/langfuse-title-deepseek-eof

Conversation

@GggggitHub
Copy link
Copy Markdown

fix: 解决 Langfuse 标题模型和 DeepSeek EOF 问题

PR Description 可以直接复制下面这版:

Description

修复 agent-chat 选择 DeepSeek 时,异步标题生成仍回退到 qwen3.5-plus,以及 DeepSeek 流式连接 EOF 未被稳定重试的问题。

根因:

  • 标题生成只读取 custom agent 默认模型,忽略本次请求的 summary_model_id,导致用户选择 deepseek-v4-pro
    时,标题生成仍可能调用默认的 qwen3.5-plus
  • 流式上游连接被中断时可能返回 eofbroken pipeconnection reset,但这些瞬时网络错误未被重试白名单覆盖。
  • 底层 rawHTTPClient 缺少响应头超时,部分上游慢失败会拖长请求耗时。

改动:

  • 标题生成优先使用本次请求传入的 summary_model_id,避免选 deepseek-v4-pro 时仍调用 qwen3.5-plus
  • eofbroken pipeconnection reset 纳入 LLM 瞬时错误重试。
  • rawHTTPClient 增加 ResponseHeaderTimeoutExpectContinueTimeout,减少上游连接异常时的慢失败耗时。

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • 🎨 Refactor
  • ⚡ Performance improvement
  • 🧪 Test
  • 🔧 Configuration / Build / CI

Related Issue

Fixes #

Testing

已在本地执行以下验证:

gofmt -w internal/handler/session/qa.go internal/agent/const.go internal/models/chat/remote_api.go
go build ./internal/handler/session/... ./internal/agent/... ./internal/models/chat/...

验证结果:
- Go 文件格式化通过。
- 受影响的 handler、agent、chat package 编译通过。
- 本 PR 未修改 UI,无需截图或录屏。

Checklist

- make fmt && make lint && make test pass locally
- Self-reviewed the code
- Added/updated tests covering the change
- Updated related documentation (README, docs/, Swagger annotations, etc.)
- Breaking changes are clearly called out in the description above

Screenshots / Recordings
<img width="1904" height="781" alt="image" src="https://github.com/user-attachments/assets/a114f15f-91be-4931-8a3a-a84a248e3ffc" />

N/A. This PR does not include user-visible UI changes.

修复 agent-chat 选择 DeepSeek 时标题生成仍回退到 qwen3.5-plus,以及 DeepSeek 流式连接 EOF 未被稳定重试的问题。

根因:标题生成只读取 custom agent 默认模型,忽略本次请求的 summary_model_id;流式上游连接被中断时返回 eof/broken pipe,但重试白名单未覆盖这些瞬时网络错误,底层 raw HTTP 也缺少响应头超时。

改动:
- 标题生成优先使用本次请求传入的 summary_model_id,避免选 deepseek-v4-pro 时仍调用 qwen3.5-plus。
- 将 eof、broken pipe、connection reset 纳入 LLM 瞬时错误重试,并为 rawHTTPClient 增加响应头/Expect-Continue 超时。

验证:
- gofmt -w internal/handler/session/qa.go internal/agent/const.go internal/models/chat/remote_api.go
- go build ./internal/handler/session/... ./internal/agent/... ./internal/models/chat/...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant