Repository navigation
[Bug]回合运行中改模型/思维强度/权限,会让会话所有工具调用失效(sessionProjections in inactive context) #10007
Replies: 4 comments
Both error lines are disposal symptoms, not a missing pluginThis is the same failure family as #9812 (and #8857), and the two messages in your log are not two bugs. Neither of them says "a plugin is missing"; both say "something that used to be loaded is not loaded any more". Reading them literally is why this report keeps getting filed as a plugin-installation problem.
Both are therefore the same event seen from two readers — one host reader (the permission preset service) and one agent-scoped reader. Your own evidence already rules out the whole-host story: #9812's follow-up has healthy sessions in the same process, same profile, minutes apart, and the wedge is per session. That is exactly the shape of one agent scope going down, not of the plugin tree being rebuilt. Why
|
|
谢谢分析,两条报错都指向「东西曾经加载过、现在没了」,这个解释和我们看到的现象能对上。补三件事:发布之后又抓到两次复现、宿主机日志的获取限制,以及想请教怎么拿到你要的那三行。 1. 发布后又复现了两次,都符合「上一轮结束后改配置,下一轮首次工具调用失败」会话 A(21:23 CST,原报告里的那个会话):
会话 B(21:42 CST,新开的会话):
两次都是「 2. 这个桌面版拿不到 host 日志我们按建议去抓 Desktop 的宿主日志,结论是这版(
我们确实抓了一次 host stdout( 3. 想请教怎么拿到那三行
4. 另一个可能相关的观察同一 host 上,会话切到「自动审查」预设后,工具调用全部 |
独立样本:换模型后第 6 个事件即出现
|
| 会话 | aborted before dispatch |
inactive context |
Auto review ... failed |
|---|---|---|---|
84ddee67 |
18 | 18 | 0 |
5823b939 |
10 | 7 | 0 |
72affdcb |
10 | 0 | 1 |
06fc3cbc |
9 | 16 | 2 |
f35f9d74 |
0 | 4 | 4 |
| 合计 | 47 | 45 | 7 |
这两类错误的预设归属不同,必须分开说:
aborted before dispatch+Auto review ... failed(共 54 次):53 次在preset=auto,1 次在danger-full-access(某会话切走后的余波)。即基本可视为auto专属inactive context(共 45 次):与预设无关,跨预设出现 ——auto27 次、无 preset 事件阶段(session 起始)15 次、workspace-write3 次
即 inactive context 的 45 次里有 18 次(40%)发生在非 auto 下,不能说它只与 auto 共存。
对照片段(只对 aborted before dispatch 有效):
| 会话 | workspace-write 片段 |
其中 aborted |
|---|---|---|
5823b939 |
9 次 | 0 |
84ddee67 |
50 次 | 0(但有 3 次 inactive context) |
即 workspace-write 下不出现 aborted before dispatch,但可以出现 inactive context。
这与本贴的 aborted before dispatch 表现一致,也与 #10041 独立统计(125 份日志中仅 2 份含 ABORTED_BEFORE_DISPATCH,且都在 auto 下)方向一致。
3. auto 下的另外两条失败路径(与本贴症状不同,但同源)
这两条容易被误并入 inactive context,故单独列出。
(a) 审查器找不到被调用的工具 schema —— 2ms 同步抛错,不发 LLM 请求
Error: Auto review of tool "bash" failed; its body was not executed:
auto-review: the pending native tool schema is missing or ambiguous
实测该会话 request/header 下发 200 个工具,其中不含 bash(只有 ops_bash)。nativeAction() 要求「恰好一个同名 schema」:
const schemas = candidates.filter(s => isRecord(s) && s['name'] === exec.name)
const [candidate] = schemas
if (candidate === undefined || schemas.length !== 1)
throw new Error('auto-review: the pending native tool schema is missing or ambiguous')模型一旦调用未注册的工具名,审查器自身先抛错,整个调用被 failed() 转成 deny。一个上游健壮性问题:这里更适合放行给下游、由 tools 层返回正常的 unknown-tool 错误。
(b) 审查器复用会话模型 → 免费模型下 429 直接变成工具禁用
classifyRisk() 从 session.requestHeader() 取 provider/model 作为审查路由,即审查请求跑在当前选中的同一个模型上。实测 preset=auto + 社区中转的 flash-free 模型时,连续 4 次:
Error: Auto review of tool "edit" failed; its body was not executed:
auto-review: reviewer ended with error RATE_LIMIT: 429: {"type":"FreeUsageLimitError","message":"Rate limit exceeded..."}
切成官方 deepseek-account/deepseek-flash 后,同一会话后续 65 次 tool/result 中 0 次出现该限流错误(其中 4 次为其它类型错误,与限流无关)。这与 #1455(zen 免费档 UA/限流)同源,但对本贴的意义是:auto 会把「模型不可用」放大成「所有工具不可用」,因为审查失败走 failed() → deny,不会降级成普通审批。
4. 一个可用于归因的耗时判据
区分这几类失败时,耗时比错误文案可靠:
| 失败 | 耗时 | 是否发过审查 LLM 请求 |
|---|---|---|
Auto review ... schema is missing or ambiguous |
~2ms | 否,同步查表即抛 |
Auto review ... RATE_LIMIT / TIMEOUT |
137–267ms(单次尝试,不重试) | 是 |
aborted before dispatch |
1.0–3.6s(p50 1377ms,46/47 >100ms) | 是,审查往返后才 cancel |
inactive context |
不定 | — |
前两条在本次样本里只出现在 auto;aborted 也基本只出现在 auto;inactive context 与预设无关。
5. 与已有报告的关系
- 本贴([Bug]回合运行中改模型/思维强度/权限,会让会话所有工具调用失效(sessionProjections in inactive context) #10007):补上「换模型 → 首批失败」的精确间隔(6 事件 / 5.5s),以及
auto预设的故障集中度 - [bug] Auto review: every remaining tool call returns "aborted before dispatch" after a mid-turn /permission auto switch #10041:补上
aborted的耗时分布,以及它与 schema 错误 / 限流错误的区分判据 - [Bug] Live sessions become permanently tool-dead and lose the permission picker: cannot get required service "sessionProjections" in inactive context, turn/end still reports completed #9812:本机 45 次
inactive context中turn/end同样是completed,确认不是 dispose,属于同一僵尸态 - OpenCode zen 免费模型(big-pickle)在 DSH 中必现 429 FreeUsageLimitError(附修复补丁) #1455:补上「审查器复用会话模型」使 429 直接放大为工具禁用的链路
6. 复核方法
所有计数来自 ~/.dsh/sessions/<id>/session.v4.jsonl.zstd 的解码。注意该文件是逐次追加的 zstd 帧串联,单次 zstd -d 只能解出第一帧;需按 28 b5 2f fd magic 分帧后逐帧解压,否则会漏掉绝大部分事件(我一开始就只解出 201 字节 / 144KB)。解码后按 tool/result 的 message.isError 与文本指纹分类即可复算上表。
如需,我可以贴出脱敏后的提取脚本。
补充一句关于 #10040:那边的第三条回复已经给出 Cordis vendor/cordis/src/fiber.ts 分组清理「成功链跳过后续 disposer」的源码小修(含 14 项回归、反向应用验证),并明确标注尚未获得维护者确认、未部署。本贴的 inactive context 与那个「旧 hook / 旧绑定未撤销」是同一族问题,但清理小修单独并不能恢复 Auto bootstrap 失败,二者不宜互相替代。
补充证据:一种「session 出生即坏」的形态,以及宿主日志的可得性
1. 上一条已就地修正的内容(供对照,不重复展开)
2. 新证据:
|
Uh oh!
There was an error while loading. Please reload this page.
故障现象
会话跑到一半,工具突然全部调不动,之后每次调用都是:
(#9812 的报告里前面还会先出现
permission: permissions session projection is not registered;我这边只出现上面这条。)几个特征:
turn/end仍然是completed,会话看起来还活着,但 nested 工具调用全死;run_code外层还能跑(里面纯 Node 的代码正常),只有tools.*内层绑定全部失败;环境
0.2.1-rc.1和0.2.1-rc.2都遇到;历史日志显示更早版本(0.2.0-rc.2 及更早)同样出现过desktopdsh-base、dsh-web-app、agent-team-profile、auto-review、voice-input-bundle、dsh-whale-widget、anysearch、experimental-terminal-bundle、experimental-session-search、dsh-ops、@memtensor/memos-local-plugin、tool-worktreecordis.patch.yml的第三方插件(没有 pet 之类),可以排除 [Bug] Live sessions become permanently tool-dead and lose the permission picker: cannot get required service "sessionProjections" in inactive context, turn/end still reports completed #9812 里怀疑的「第三方插件写 patch 层」这条路径触发经过
今天下午干活时,我先后两次调整「思维强度」:先
high→max,后来max→high。两次之后工具都开始报inactive context,整个会话卡死。一开始以为是偶发,后来翻 session log 才确认两次都对应得上。下表中的时间都是 UTC,与 session log 里的时间戳保持一致:
maxmax,09:43:19 起连续 16 次inactive contexthighhigh,12:22:43 起 又出现同样错误这个会话全程只有这两簇错误,两次都对应改设置。核对轮次归属后,失败时机也更清楚了:
model/selection,下一轮(第 24 轮)09:43:10 开始、09:43:11 的请求用上新配置,09:43:19 第一次工具调用就失败;也就是说,重建发生时正在执行的请求不受影响,失败的是它之后的下一次模型请求——这次请求可能属于同一轮的下一步,也可能属于下一轮。这和「上一轮结束/运行中发生重建,下一轮工具就挂了」是同一个现象,只是第二次恰好在同一轮内就进入了下一个请求。
排查过程
一开始怀疑的是第三方插件。dsh-ops 接管了 shell 和文件工具,
pre-execute也挂在工具链上,看起来最像嫌疑。但读它的代码后可以排除:它只发布ops_bash这类带ops_前缀的工具,pre-execute只对固定的禁用工具名返回 deny,跟sessionProjections没有关系。接着怀疑版本。rc.2 刚更新不久,时间点很近,所以把 npm 上 rc.1 / rc.2 的
auto-review、dsh-tools、user-approval、permission-presets、agent-loop和审批 UI 包都拉下来对比,lib 代码的 sha256 完全一致,bundle patch 也只是多了模型标签和搜索 API。版本回归这条也排除了。再怀疑服务端:限流、并发、审批通道故障。翻了相关会话的事件,
llm/retry、429、request/error一个都没有;审批事件确实触发过并正常完成。所以也不是外部服务或审批链路。三个方向都排除后,回到日志本身。把
~/.dsh/sessions/*/session.v4.jsonl.zstd按事件顺序展开,盯着工具失败前后的上下文看,发现每次失败前面都有同一个模式:model/selection→ 下一次request/header用上新配置 → 几秒后开始报错。两次改设置,对应两簇错误,没有例外。为了确认这不是巧合,又把全部历史会话扫了一遍:同样的错误最早出现在 2026-09-12,0.2.0-rc.2 时期也反复出现。同时发现触发面不止改模型——切权限预设、插件热重组合之后也会出现同样的错误。到这里才确定问题不在某个具体设置项,而是运行中重建 session/agent 绑定时,旧的 tool binding 没有失效。
复现步骤
high调到max(或反向);sessionProjections in inactive context,或者整轮aborted before dispatch;request/header(或 sandbox)变化 → 首个错误 seq。我这边
0.2.1-rc.1和0.2.1-rc.2都能稳定踩到。疑似同一问题的报告
sessionProjections in inactive context、turn/end completed、权限选择器消失),主报告cordis.patch.yml杀会话,属于同一条「运行时重建」路径inactive context这个报错具有误导性,和这里看到的是同一个错误面证据
两次改强度对应两簇错误(会话 A)
以下片段直接来自 session log(
~/.dsh/sessions/<session>/session.v4.jsonl.zstd),已做脱敏:只保留事件类型、UTC 时间、模型配置、工具名和错误首行;用户消息、命令参数、工具输出和本机路径都没有包含。
原始日志含用户对话内容,不适合整份公开;如果需要,我可以提供更多脱敏后的片段。
历史会话扫描
扫描
~/.dsh/sessions下全部会话,出现过该错误的如下(备注里的时间同样是 UTC,方便直接对照 session log):session-484c9ddfmax→ 17:23:19 首次报错7d50bea4session-ce82e74asession-368a5643session-b114ab7f1268315f/38e0a3c7/b39032fb/55165f3f权限切换与插件重组合的观察
以下为本地时间(CST)。
auto,同一分钟内启用 MemOS 触发重组合(cordis.yml被重写),随后整轮工具调用aborted before dispatch;切回workspace-write后恢复;auto,立刻出现Auto review of tool "write" failed并连续失败,切回预设后恢复;inactive context。All reactions