Repository navigation
spill 文件超过上限后被删除,披露退化为 (unavailable)(0.1.5-rc.3,附文件行号) #7854
Replies: 3 comments
包内文档写的意图与你观察到的结果不一致——这正是你这条的价值1. 文档原文(
|
|
按你的要求补四项:代码本身、复现到删除那一步、版本号,以及 版本身份
一、代码:删除链路(产物)
/** Open the spill file lazily and append `chunk` (and any prior chunks once). */
spillAll(chunk) {
if (this.maxSpillBytes !== void 0 && this.total > this.maxSpillBytes) { // :760
this.discardSpill(); // :761
return;
}
if (this.spillFd === void 0) {
this.spillFile = join(this.spillDir, `dsh-subprocess-${process.pid}-…-${this.label}.log`); // :765
this.spillFd = openSync(this.spillFile, "wx", 384); // :766
for (const prior of this.chunks) writeSync(this.spillFd, prior); // :767
}
writeSync(this.spillFd, chunk); // :769
}
/** Stop spilling and remove the file once it can no longer hold the complete stream. */
discardSpill() {
const fd = this.spillFd; // :773
const file = this.spillFile; // :774
this.spillFd = void 0; // :775
this.spillFile = void 0; // :776
this.spillDisabled = true; // :777
if (fd !== void 0) try { closeSync(fd); } catch { this.spillFd = fd; } // :778-:782
if (file !== void 0) try { unlinkSync(file); } catch {} // :783-:785
}落盘条件以 if (!this.spillDisabled && (overflows || this.spillFd !== void 0)) this.spillAll(chunk);因此 符号与位置的对应关系(这一组是我在原报告中写错的地方,已更正):
原报告把常量位置写成「 二、代码:披露链路(产物)
/** Append the truncation notice (with the full-output spill path) to a stream's text. */
function streamText(output) {
if (!output.truncated) return output.text;
return `${output.text}\n[output truncated; full output: ${output.spillPath ?? "(unavailable)"}]`; // :48
}后台读取路径同形,同文件 三、复现到「删除」那一步删除是累积字节数的判定,不是单条命令规模的下限,因此把上限调小即可在秒级复现,不需要真的产出 64 MiB 输出。
实测结果(已执行,不再是设计稿):在本机用一次性 上述文本取自该次运行的会话日志中
因此实测让第 4 步的判据从「应当观察到」变成「已观察到」,并额外暴露出本报告原先没有写清的三层结构,见下一节。 四、你要的关键区分:不是二选一,而是三层结构,每层的答案不同你在评论中问
两处落盘的位置与上限都不同:执行器那道在每进程私有的 所以对你的问题,答案是:
原报告把「披露退化为 五、
|
你的三处更正我接受——我引错了层,而且引错了对象1. 先承认错在哪我把
⇒ 我把两条独立路径混为一谈,正如你说,会把本条从"披露不携带成因"误读成"spill 策略违反了自述承诺",而后者不成立。这一处是我的错,请你按你的准确表述提交。 顺带交代我当初为什么会引它: 2. 你的两处引用我在最新版上核过了,都成立当前
⇒ 也就是说:"删除不完整 spill"是写明的设计意图,而"不删除已完成的 spill"讲的是另一回事——你提醒"引 3. 一条版本提示(对你有用)
但请注意目录在 0.2 线搬过家: 4. 你的第 8 节诉求我支持"不主张改变删除行为,只要求模型侧披露与已知事实对齐"——这个定性我认为是对的,而且第 2 条(在工具包 README 里列全 5. 版本口径你已声明结论限定在 |
Uh oh!
There was an error while loading. Please reload this page.
spill 文件超过上限后被删除,披露退化为
(unavailable),模型无法区分两种成因环境与方法
@deepseek-ai/dsh与全部@deepseek-ai/dsh-*包 0.1.5-rc.3。文件:行指 npm 包内的构建产物,即node_modules/@deepseek-ai/<包名>/lib/,不是仓库源码行号。dsh-subprocess-local/lib/下的构建产物带内容哈希,下面出现的文件名取自 0.1.5-rc.3。机制
单流输出超过
maxSpillBytes时,spill 文件被删除,该流在本次执行内不再落盘,而模型侧看到的披露退化为同一个(unavailable)文案。默认值为 67108864,见
dsh-bash-local/lib/index.js:89与dsh-pwsh-local/lib/index.js:162的const DEFAULT_MAX_SPILL_BYTES = 64 * 1024 * 1024;,配置项是同包:133的maxSpillBytes。删除链路在
dsh-subprocess-local/lib/runner-launch-COYGu0Dl.js::760判定if (this.maxSpillBytes !== void 0 && this.total > this.maxSpillBytes) {,命中即执行:761的this.discardSpill();。discardSpill()在:777置this.spillDisabled = true;,在:784执行unlinkSync(file);。:742的落盘条件以该标志为前置,if (!this.spillDisabled && (overflows || this.spillFd !== void 0)) this.spillAll(chunk);,因此置位后该流不再落盘。模型可见的披露在
dsh-tool-bash/lib/index.js::41返回`${output.text}\n[output truncated; full output: ${output.spillPath ?? "(unavailable)"}]`。:89是同一退化在后台进程增量路径上的对应实现。影响
模型侧只有
(unavailable)一种形态,该文案不携带成因。除超限删除外,关闭 spill 文件失败时同样会走到该文案。模型因此无法区分「从未落盘」与「落盘后被删除」,也无法判断内容是否曾经可读。复现
构造一条单流输出超过
maxSpillBytes的命令即可观察到该文案,把上限调小可以缩短复现时间。All reactions