Repository navigation
feat(spill): P1.1 大输出 tool_result 补齐 tail 预览 (closes #83) - #84
Merged
Merged
Conversation
审计确认 spill 机制已存在 (persist 命名), 真 gap = tail-only 预览。 generatePreview 原 head-only, spec §P1.1 要 head/tail。截断时产 head(60%)+tail(40%), 按行边界切, 总字节 ≤ 原 budget, 不膨胀上下文。 非截断时 tailPreview=undefined, buildLargeToolResultMessage 旧行为 byte-identical (向后兼容)。 - toolResultStorage.ts: PersistedToolResult 加 tailPreview?; generatePreview 产 head+tail; buildLargeToolResultMessage 拼 head+省略+tail; persistToolResult 透传 tailPreview - BashTool/PowerShellTool: persisted-output 字面量透传 tailPreview - 新增 toolResultStoragePreview.test.ts (9 case) typecheck 0; 449 test pass; build + build:dev:full pass。 Closes #83 Co-Authored-By: Claude Fable 5 <[email protected]>
dahai80
added a commit
that referenced
this pull request
Aug 20, 2026
追 CC 2.1.196→2.1.234 Tier-1 特性批量落地 (13 PR): 变更自 v0.4.22: - WS1 DirectoryAdded hook + Notification agent_* 类型 (#73) - WS2 堆叠 slash-skill 调用, 最多 5 前导 (#74) - LSP+filecache 内存泄漏 cap, 对齐 CC 2.1.208 (#76) - skill body-defer 懒加载, item 9 (#78) - SessionStart source "fork" 区分 fork 与 resume (#80) - P2.1 子代理护栏 — 并发/会话/深度三限 (#82) - P1.1 大输出 tool_result tail 预览 (#84) - P4.1 --ax-screen-reader 入口点对齐 — env 别名 + settings key (#86) - item 13 WebSearch per-session 搜索次数上限 (#88) - P4.2 §6 /doctor FUSION_* vs ANTHROPIC_* 环境变量冲突检测 (#90) - P4.2 #1+#3 /doctor MLX 网关连通 + 模型加载探测 (#92) - item 4 MCP 工具自动后台化 FUSION_MCP_AUTO_BACKGROUND_MS (#94) - item 22 审计日志凭证脱敏 (#96) - package.json: version 0.4.22 → 0.4.23 Co-authored-by: Claude Fable 5 <[email protected]>
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.
背景
enhance-0819.md §P1.1 Spill 策略 (DSH #8) 要 head/tail 预览 + disk locator。
审计结论: spill 机制已在 fusion-code 存在 (命名
persist非spill)。memory 旧记录 "grep spill=0 确实缺" 为误判 — fusion-code 用persist命名, grep literal CC 术语漏掉。真 gap 收窄为 tail-only 预览:generatePreview原 head-only, spec 要 head/tail。改动
generatePreview截断时产 head + tail:maxBytes→ 不膨胀上下文tailPreview=undefined→buildLargeToolResultMessage旧行为 byte-identical (向后兼容)文件
src/utils/toolResultStorage.ts:PersistedToolResult加可选tailPreview?;generatePreview产 head+tail;buildLargeToolResultMessage拼 head+省略标记+tail;persistToolResult透传src/tools/BashTool/BashTool.tsx: persisted-output 字面量透传tailPreviewsrc/tools/PowerShellTool/PowerShellTool.tsx: 同 Bashsrc/__tests__/services/tools/toolResultStoragePreview.test.ts: 新增 9 case (head+tail 不重叠/行边界/字节预算/向后兼容)不动 (Rule 3 surgical)
selectFreshToReplace: pre-persist 减全 size, 已近似 (注释 "previews ~2K"), tail +~0.8KB 在误差内Infinity跳 persist) — 故意mcpOutputStorage.ts) — 独立路径验证
bun run typecheck→ 0 errorsbun test src/__tests__/ tests/→ 449 pass, 0 failbun run build+bun run build:dev:full→ passbunx biome check→ prod 文件 0 新增 lint (既有 baseline 不动); test 文件 0 error/warninggit diff -w确认无 whole-file reformat churn实益
MLX 日志工作流: 错误/stack trace 在输出尾部, 原 head-only 看不到; tail 补齐后模型直接见尾部错误 + locator 读回全文。
Closes #83
Co-Authored-By: Claude Fable 5 [email protected]