Repository navigation
Feat/3.1.0 beta1 - #2664
Merged
Merged
Feat/3.1.0 beta1#2664
Conversation
当上游通过 HTTP 200 SSE 返回上下文超限时,LangChain 会抛出 `ContextOverflowError`,但仍可能保留代理的通用 `upstream_error` 代码。DSH 只读取 `.code`,导致客户端收到通用模型错误,无法识别自动压缩恢复条件;同步超限的账本分类也会被 HTTP 400 覆盖。 本次统一识别异常链中的 `ContextOverflowError` 和明确的 `context_length_exceeded`,让 JSON/SSE 公共错误及账本保留既有超限语义。异常链遍历有深度和循环保护,供应商原文不对外暴露。同步更新 F062 设计中的已知坑;不改变模型窗口或客户端压缩策略。 验证: - 新增回归在修复前复现失败;使用真实 OpenAI SDK / LangChain 与 httpx 模拟上游,覆盖同步拒绝、HTTP 200 流内错误、包装异常和未知错误脱敏。 - `pytest test/dsh/test_model_errors.py test/dsh/test_model_service.py test/dsh/test_native_responses.py -k 'not real_redis'`:71 passed,2 deselected(需要独立 Redis)。测试使用现有 Python 3.12 环境及临时空配置。 - ruff check / format、变更 Python 文件的 arch-guard、git diff --check 通过。 - 按 sdd-code-review 七维度自审通过;这是恢复既有错误契约的热修复。 尚未部署,也未验证真实 Desktop 压缩及重试全链路。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
简要描述做了什么改动。
Why
为什么需要这个改动?
How
实现方式、设计决策(如有)。
Test
Related