Repository navigation
Replies: 3 comments
|
根治:向 DeepSeek Harness 上游报告 .filter 未判空缺陷 + developer 角色泄露到 openai-completions 路由 + turn/end 缺堆栈三个问题 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Title:
0.2.2-rc.1: turn preStep crash "(reading 'filter')" on sessions with developer/messages after provider rename+restart; developer-role messages leak to custom openai-completions routes (HTTP 400); turn/end errors lack stack
Summary
在 0.2.2-rc.1 桌面端(Windows)遇到两类相关故障,并附一个可观测性缺陷:
Cannot read properties of undefined (reading 'filter')。会话历史中含developer/message(工具注册表抖动产物)的 bot 会话,在「provider 改名 + 配置层重写 + 宿主重启 + 插件升级」后,每个回合在turn/start之后、step/start之前约 170ms 内崩溃(无step/start、无request/header),连续 4/4 必现,该会话从此不可用。role:"developer"内部消息(agent-loop 的 tool-addition/tool-removal 通知)被投影进请求发给自定义 openai-completions 网关,后端拒绝该角色,报400: {"message":"developer is not one of ['system', 'assistant', 'user', 'tool', 'function']","type":"invalid_request_error"}。turn/end错误事件不带堆栈:崩溃只记录{"message":"Cannot read properties of undefined (reading 'filter')","code":"UNKNOWN"},无法从日志归因到具体帧(本次是解包 asar 静态比对了 6 个核心包才定位到疑似帧)。Reproduction
按实际发生条件的复现路径(非最小脚本,如实说明):
developer/message(由插件兼容门禁导致的工具注册表抖动产生:43 个工具先tool-removal再tool-addition)。api: openai-completions)在 patch 层改名,同时 patch 层被设置界面重写、其中agent-preset-registry配置项被一并丢弃;宿主重启。重要对照:在同样的会话历史上(含正常的 developer 消息),provider 改名前曾有连续 20 个回合正常运行——所以崩溃触发点是重启后的状态组合(疑似插件对
system-prompt/assemblewaterfall 的转换返回了缺contexts的 assembly,且预设配置被丢弃后 runtime context 被抑制),而非「历史里有 developer 消息」本身。Current behavior
事件时间线(Asia/Shanghai,来自本机会话日志
session.v4.jsonl.zstd,多帧 zstd):静态比对 asar 内 0.2.2-rc.1 核心包,疑似/相关缺陷帧(均在该崩溃路径上、对 undefined 无守卫):
@deepseek-ai/dsh-system-prompt/lib/index.jsL411:contexts: runtimeContextSuppressed ? transformed.contexts.filter(...) : transformed.contexts—— L401 的system-prompt/assemblewaterfall 允许插件改写 assembly;插件返回缺contexts的对象且runtimeContextSuppressed为真时,正好undefined.filter。与本机时序吻合(patch 层重写丢弃agent-preset-registry配置 + ds-bot 0.2.2→0.2.7 升级恰在崩溃起点前)。@deepseek-ai/dsh-llm/lib/index.jsprojectToolUpdatesL803history.tools.filter(...)、L811message.content.filter(...):developer 消息投影路径,接收端无判空。@deepseek-ai/dsh-agent-loop/lib/index.jsL1048:tools.filter(...)与同函数内baseline.tools?.map(...)(L1046)守卫不对称。400 问题的机制面:
withoutDeveloperMessages仅在路由未声明 toolUpdate 模式时剥离 developer 消息;自定义 openai-completions 路由被投影保留后原样发送,被网关拒绝。另外 seq 2033 那条 developer/message 没有 headerSeq,与assertDeveloperHeader期望的形态不符(折叠层用空 definitions 容忍了它)。Expected behavior
role:"developer"的内部消息默认不发送给未声明接受该角色的路由(按 API 能力剥离或降级),避免 400。turn/end的 error reason 中至少在诊断日志层附带 stack。Environment
session.v4.jsonl.zstd是多帧 zstd——用单帧decompress()只能读到重启前的第一帧,会漏掉重启后的全部事件(本次排查踩过),需流式解压读取All reactions