报错让你调大超时,真因是模型的思考 token
文中时间均为北京时间。 上一篇刚给记忆服务的后台刷新加了 6 小时节流,转头我又干了件自以为省钱的事:把两个心智模型的刷新从 full 切成官方知识页推荐的 delta。 {"mode": "delta", "fact_types": ["observation"], "exclude_mental_models": true, "refresh_after_consolidation": true} delta 只读「上次刷新之后变动过的记忆」,对现有内容做外科手术式编辑;full 每次重读全量、从头重写。听起来稳赚。 切完之后,接连 5 次刷新全部失败(前 3 次是默认配置,后 2 次分别在调大墙钟、调大读超时之后),报错原文: Task exceeded the 300s wall-clock limit for 'refresh_mental_model' (stage=llm.openai.mental_model_delta_ops.attempt=1/4.backoff) and was cancelled. Raise HINDSIGHT_API_REFLECT_WALL_TIMEOUT if this is a legitimately long operation, or set it to 0 to disable the limit. 最后一行是引擎给的修复建议:把墙钟调大。我照做了,掉进两个坑——而这两次「按报错提示调参」,正好把整轮排查的过程摊开了。 一、越调越糟的两次尝试 时间 动作 结果 08:58:21 delta 首次刷新 300s 墙钟超时 09:40:18 重试(同时有别的任务在跑) 300s 超时 10:01:31 干净环境重试,排除抢资源 300s 超时,假设一推翻 10:09:46 墙钟 300s → 600s 600s 照样超时:10 分 08 秒只完成 5 次工具调用 10:21:38 读超时 120s → 300s 更糟:只完成 1 次工具调用就耗尽墙钟 失败还有个副作用:last_refresh_failed_at 晚于 last_refreshed_at 时模型会被冻结,代码注释写着这个字段 “is what stops the automatic triggers” —— 它是熔断器,防止配置一直失败还一直烧钱。代价是心智模型停更了 1.5 小时(08:58–10:36)。 ...