Repository navigation
fix(memory): 额度不够导致「整理成功但记 0 条」——放大重试 + 额度可调(#239) - #245
Open
Britneycode wants to merge 1 commit into
Open
Britneycode wants to merge 1 commit into
Britneycode wants to merge 1 commit into
Conversation
Britneycode
added a commit
that referenced
this pull request
Nov 29, 2026
Closed
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.
Why
修复 #239。报告者补充了关键信息:他贴的是 7 天视图(11-02 才装的鱼),「从昨天开始一条聊天记忆都没入库,刷视频那几条除外」,手动点「现在整理」显示成功但记 0 条,把额度从 2000 改成 8000 后立刻恢复,而设置页根本没法调额度。
真因:
extract/dream写死maxTokens: 2000、diary1500。推理模型把额度全花在思考上、正文为空 ⇒ 判失败 ⇒ 连续 5 次丢弃整批 ⇒ 记忆永久丢失。而 #181 当年假设「思考吃满 ⇒ 放大到 8000 也空」,于是无条件跳过放大重试 —— 这个假设被真机反证。What
thinkAteBudget不再无条件跳过。第一次仍放大一次;只有「已经放大到顶还是空」才认定没救。到顶还空时记进roomy(下次直接用 8000,不再从小额度白烧)。maxTokens,由LlmRouter按models.<feature>.maxTokens决定;兜底从 1500 提到DEFAULT_MAX_TOKENS = 4000。models.<feature>.maxTokens打通cleanModels白名单 →/models/state→ 「按功能选模型」每个功能后面的额度输入框(留空 = 默认 4000)。Verification
test/issue-239-maxtokens.mjs(4 组):放大一次能成、到顶才放弃、兜底 4000、配置生效thinkAteBudget改回无条件跳过 → 测试红契约变更(断言对象随行为变,强度不降)
llm-failure-backoff:EMPTY_RESPONSE + think 现在[1200, 8000];到顶还空记进 roomyllm-roomy-budget:思考吃光额度改为「先放大一次」dsh-desktop:schedule 每天第一次调用必交白卷:默认 maxTokens=600 放不下推理模型的思考 #58 的「默认 1500」改为「默认 4000(常量)」Closes #239