zai-org / zai-org/feedback

[Bug] 会话上下文工具(ReadSessionContext)大概率超时失败:"Tool execution timed out after 300000ms",单次/并行调用均会出现

Open
#582 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

环境
  • ZCode 桌面版 3.11.2(3.11.2.6792)
  • Windows 11 x64(10.0.26200)
  • GLM Coding Plan Lite
现象

会话进行中,模型调用内置「会话上下文」工具(ReadSessionContext)读取历史 session 时,有较大概率执行失败,错误信息统一为:

Tool execution timed out after 300000ms

工具卡片显示「执行失败」。该问题出现频率很高,基本每天多次。

复现
  1. 正常会话中,模型为恢复前文调用「会话上下文」工具(传入查询 + 目标 session id)。
  2. 无论是与其他工具并行调用(截图 1:同时调用 git 命令 + 2 个会话上下文),还是单独调用一次(截图 2:仅 1 个会话上下文调用,该轮无其他并行工具),都会出现。
  3. 等待 300000ms 后报错。值得注意:即使注定失败,客户端也会完整等待 5 分钟才返回错误,期间该轮被阻塞。

目标 session 本身并无异常(可正常通过 sess_* 引用),且部分被读取的 session 并不长,不像是个别 session 数据过大导致。

影响
  • 每次失败浪费 5 分钟等待,长会话中连续失败会明显拖慢任务。
  • 模型拿不到历史 session 上下文,只能降级去翻盘内报告/脚本恢复信息(截图 2 中即如此),上下文连续性被打断。
期望
  1. 排查 ReadSessionContext 的读取链路延迟/挂起原因(疑似后端读取历史 session 时偶发不响应)。
  2. 短期缓解:将超时改为可配置,或失败后自动重试一次;失败尽快返回,不要占满 300 秒。
关联 issue
  • #30(MCP 工具超时硬编码不可配置,同类诉求)
  • #313(涉及同一 ReadSessionContext 工具)
截图

截图 1:并行调用场景(git 终端 + 2 个会话上下文调用,1 个报 300000ms 超时);

Image

截图 2:单次调用场景(仅 1 个会话上下文调用,等待 5 分钟后超时失败,模型降级读取盘内文件)。

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ReadSessionContext tool entry point and reproduce the failure in both standalone and parallel calls, using the reported 300000ms timeout as the trace boundary. Compare the behavior and discussion in related issues #30 and #313; done means identifying the delayed or hung read path and documenting a verified way for failures to return promptly.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.