Repository navigation
[Bug] 长会话中工具调用标签畸形与写入静默失败:动作不执行且无错误提示 #11532
Replies: 1 comment
|
Thank you for the detail — the B-class table is the most useful part of this report, and it is reproducible without the session: the write tool answers from the value its filesystem backend returned, and nothing re-opens the file. What I measuredI mounted the shipped tools (
Why the loop cannot catch it
It also explains why your encoding theory did not hold (B-10, and your own follow-up): the defect is not in the path, it is in the confirmation being written from an assumption instead of an observation. Whatever the cause of a given miss, the tool's answer is the same either way, and that is what makes it unfalsifiable at the call. What exists now
dsh plugin --profile <name> add "github:argszero/dsh-write-readback-guard#v0.1.0"It listens on
Then, addressed to the model, because the model is the one that would otherwise report the work as done: Do not report this change as done. Write it again, then read the path before continuing. Measured on the installed copy (installed through the tag with
The boundaryThis catches one tool's own false report at that call; it is not a filesystem guarantee, and a second reader of the file can disagree with a disk that moved underneath it. It cannot see a write that lands and is later reverted, it does not detect a file changed by another process after the read-back, and it cannot help with B-5 (a PowerShell write that prints "done") because that never went through a tool whose result could be checked. I am also not claiming your A-class (malformed VersionsYour sessions run 0.2.1-rc.2/rc.3; npm The durable fix belongs in the tools: they could re-read before answering. This project's issue and pull-request channels are closed, so I cannot offer that as a patch; the plugin is what a deployment can add today. On your other reportThe destructive-delete veto ( |
Uh oh!
There was an error while loading. Please reload this page.
DSH 问题报告:工具调用标签畸形与静默失败
E:\opencode\CampusAPI0. 摘要
本次长会话中,工具调用出现两类故障。两类都会在无用户可见错误的情况下破坏动作,
表现为「助手说到一半停住」,用户必须手动输入「继续」才能推进:
invoke/parameter闭合标签错位或多出write/edit回updated successfully,文件内容未变核心诉求
建议解析后、执行前做标签配对校验,并把失败原文片段回显给助手。
1. A 类复现样本(标签畸形)
A-1 消息开头出现孤立闭合标签
助手输出形态(原文,出现在回复最开头):
「你为啥老是输出这些内容,且会话也停下来」。
A-2
parameter/invoke闭合错位(多一个</parameter>)助手输出形态:
git push未执行。随后git rev-list --left-right --count origin/main...HEAD仍显示未推送,证明动作确实没发生(重发后才成功:
47ced32..98ca983)。A-3
invoke名称被写成属性片段助手输出形态:
<name">…Error: unknown tool "name" string="true"name),定位帮助有限。期望错误应指出「工具调用结构不合法」,并回显片段。
A-4
git bundle create因同类畸形未执行Get-Item得到找不到路径"C:\Users\fly04\AppData\Local\Temp\ynedut_docs2.bundle"。A-5 观察到的规律(样本量小,非统计结论)
git status)推测:畸形与输出长度、特殊字符密度、单回合多调用结构相关。
若可获取原始补全文本,建议核对长参数块之后是否出现标签闭合的重复或截断。
2. B 类复现样本(静默不写入)
这一类标签完全合法、工具返回成功,但文件未变。全部由写入后回读才发现。
server/src/campus_mcp/setup.py(/setup页脚)editgrep '服务版本'无输出 → 未写入deploy/README.mdwriteTest-Path为 Falsedeploy/maintenance.shwriteput报No such filedocs/agent-接入指引.md(登录章节重排)editfindstr /C:"首选:门户三步"→ 无输出(exit 1)AGENTS.md(新增条目)donedocs/dsh-问题报告-工具调用标签与静默失败.md(本报告首次尝试)writedir docs\*.md中不存在该文件docs/dsh-bug-report.md(同样的内容、ASCII 文件名)write这比「报错」更危险——用户无法察觉。
stat+ 关键内容比对;不一致时返回write_not_applied之类的显式错误。3. 另一类:命令永久阻塞导致回合终止
虽非标签问题,但同样表现为「回复中断」,一并报告。
git commit(-m未被干净消费时)依据系统级配置core.editor = notepad启动记事本并等待输入。用户侧表现为「又一次停住」,且提交并未发生。
git -c core.editor=true commit -m "…"后立即成功。便于区分「还在跑」与「已结束但无输出」。
4. 逐条诉求(便于跟踪)
write/edit返回前回读比对,未生效则报错。(动作后立即用只读命令验证状态)。
5. 附:该问题在本会话造成的实际损失
git commit被 notepad 阻塞,连续 3 次未产生提交git push标签畸形未执行git bundle create未执行 → 部署中断</parameter>导致回合提前结束DSH 问题报告 · 追加样本(同会话后续观察)
A-6 同一回合内连续 3 次标签畸形(git push / present)
形态:需连续执行 git push 与 present 的回合里,连续三次输出畸形:
</parameter></invoke>多闭合;</parameter></invoke></parameter></invoke>重复整组;<parameter name="command">,缺少<invoke name="…">。实际:三次均未执行;第四次按
<invoke name="…">+ 两个</parameter>+</invoke>书写才成功。证据:成功那次输出
To ssh://...4b7a185..51ab938 main -> main;失败那几次毫无输出,随后
git rev-list --left-right --count origin/main...HEAD仍显示本地领先,证明未推送。观察:畸形与「想在同一回合里连做两件事」高度相关,支持 A-5「单回合多调用更易畸形」。
B-8 edit 对同一处改动连续两次静默失败
目标:server/tests/test_login.py 中的一行断言。
影响:不做「跑测试 / 回读」校验就会连续两次误报「已修复」。
重要附加观察:未生效与内容是否含中文无稳定关联(同一行含中文与不含中文的替换都失败),
因此不要把 B 类归因于编码,应按「写入未落地」独立排查。
B-9 本报告自身的两次写入尝试(B-6/B-7 重复验证)
docs/dsh-问题报告-工具调用标签与静默失败.md(中文)+ 完整内容 → 返回 File created;随后
dir docs\*.md中不存在该文件。docs/dsh-bug-report.md(ASCII)+ 完全相同内容 → 成功(7335 字节)。两次独立尝试中稳定复现,是全篇最可能直接指向根因的线索。
B-10 「新建文件」也会静默失败(本轮新增)
随后
Select-String "^## "列标题未出现新增章节 —— 未生效。随后
Get-ChildItem docs\dsh*只有 2 个文件,没有它 —— 未生效;重试一次仍失败。说明:纯 ASCII 锚点与文件名同样失败,进一步排除「仅编码问题」的解释。
损失更新
本轮新增 A 类畸形 ≥5 次、B 类静默失败 ≥4 次;累计往返成本由约 15 轮升至约 20 轮以上。
代价特征:不是做不到,而是失败不可见 —— 助手以为完成了,用户也看不出没完成。
All reactions