Repository navigation
Replies: 2 comments
|
多调用一轮确实不爽 |
|
补充一个 #2509 没有覆盖的变体,来自 Windows 上的实测:当预设里只有 shell 工具时,「三车道」里没有一条可行车道。 场景本机 DSH Desktop Next(上游 与 #2509 的关系:机制一致,但结论需要补一条我核对过,这不是缺陷,文档甚至已经写明(
观察记录只由原生工具发出: 差别在于:在三车道模型里,「观察车道」的前提是存在
所以这里的摩擦来源不只是"模型图省事",而是提示词里没有把 shell 车道和观察车道分开讲:极简预设的固化 persona 只说"用 bash", 生态旁证
三条建议(按落地成本排序)
一句话总结:文档层面已经说清了,缺的是把这条边界送进模型看得见的地方(工具描述/错误文案),尤其是没有 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
中文 🇨🇳
摘要
当前
read/edit的模型指引是绝对化的:"Use the read tool — not shell commands like cat"、"Read the file first (the default fs-observation-policy requires it)"。实践中,这个指引对「单点语义修改」正确,但对「探索」和「批量机械变换」是低效的——shell/脚本一次管线调用胜过几十次 read→edit 往返。FS_NOT_OBSERVED摩擦的真正来源是混用车道:用 shell 读(黑盒子进程,从不登记fs/observed观察)然后再用edit工具(要求观察)。按场景路由的三车道模型可以在不削弱守卫的前提下消除这一类错误。本提案建议把该模型写进官方文档/系统提示词,并附实测数据。背景
fs-observation-policy是防止"AI 基于过期记忆覆盖用户已修改文件"的版本守卫(CAS),机制本身正确且必要。但在真实使用中(包括非开发者/运维用户),模型经常因"图省事"用 shell 查看文件后直接edit,触发FS_NOT_OBSERVED("edit requires reading ... first"),重读后重试——功能能完成,但流程噪音反复出现。根因
edit/write前必须有该文件的read观察记录(按会话 + CAS 版本比对)。无记录 →FS_NOT_OBSERVED;记录过期(read 后文件被改)→ 版本不匹配。edit改(要求观察)→ 必然冲突。选对车道即消除该类错误。三车道模型
read(同轮)→editglob/grep/ shell 只读管线补充:
read→ shell 写 →edit同一文件 = 报 "file changed since it was read"。shell 写会悄悄作废 read 快照;恢复姿势 = 脚本改完后重新read再edit。subagent/workflow工具,shell 只做聚合/预处理。实测
(2026-08-16,macOS,dsh web profile)用临时文件完整走了一遍链路:
read读文件echo >>追加edit同一文件file changed since it was readread→ 再edit另验证:shell 读(
cat)+edit→FS_NOT_OBSERVED("edit requires reading first")。建议修改
README「Model Experience / Read guidance」补充场景路由提示(建议文本):
可选:
FS_NOT_OBSERVED错误信息增强:提示"若刚才是用 shell 查看的该文件,请改用 read 工具,或整批改用 shell 写入"——把报错从"失败"变成"车道提示"。影响
报告人场景:云上陕西运维,Obsidian 知识库 + DSH 日常维护。规则已本地固化(file-edit-discipline),本提案为通用化建议。
English 🇬🇧
Summary
The current model-facing guidance for
read/editis absolute: "Use the read tool — not shell commands like cat — to inspect text files" and "Read the file first (the default fs-observation-policy requires it)". In practice this guidance is correct for surgical single edits but inefficient for exploration and bulk mechanical transforms, where shell/scripts are strictly better (one pipeline call vs dozens of read→edit round-trips). The real source of theFS_NOT_OBSERVEDfriction is lane mixing: reading via shell (a black-box subprocess that never registers anfs/observedobservation) and then editing via theedittool (which requires an observation). A scenario-routed three-lane model eliminates this error class without weakening the guard. This proposal asks for documenting that model in the README / system prompt, and includes empirical test data.Background
fs-observation-policyis a version guard (CAS) that prevents an AI from overwriting user-modified files based on stale memory. The mechanism is correct and necessary. In real usage (including non-developer / operations users), the model often reads files via shell "for convenience" and then callsedit, triggeringFS_NOT_OBSERVED("edit requires reading ... first"); after a re-read and retry the task completes, but the friction recurs constantly.Root cause
edit/writerequire a priorreadobservation (per-session CAS version compare). Missing →FS_NOT_OBSERVED; stale (file changed after the read) → version mismatch.edit(observation required) → guaranteed conflict. Route by scenario and the error class disappears.The three-lane model
read(same round) →editglob/grep/ shell read-only pipelinesedit)Notes:
read→ shell write →editsame file errors with "file changed since it was read": a shell write silently invalidates the read observation; recovery = re-readafter the script pass, thenedit.subagent/workflowtools; shell is for aggregation/preprocessing only.Empirical test
(2026-08-16, macOS, dsh web profile) A full pass over a temporary file:
readthe fileecho >>appendeditthe same filefile changed since it was readread, theneditAlso verified: shell-read (
cat) +edit→FS_NOT_OBSERVED("edit requires reading first").Suggested changes
README「Model Experience / Read guidance」: add scenario-routing hint (suggested text):
Optional: augment the
FS_NOT_OBSERVEDmessage with lane hints — "if you just viewed this file via shell, either usereadfirst, or switch the whole pass to shell writes" — turning the error from a dead-end into a lane hint.Impact
Reporter scenario: cloud operations engineer (Shaanxi), Obsidian knowledge base + DSH daily maintenance. Rule locally solidified (file-edit-discipline); this proposal is the generalized form.
All reactions