Repository navigation
Replies: 1 comment
|
Independent reproduction on 0.1.0-rc.6 / Windows 11 x64, 1. It is not escapable in-app — not even So compaction re-sends the same history and dies too, and the restart adds nothing. The 2. The log-surgery workaround did not hold here. After rewriting all 13 3. Related thread: #9911 covers the 422 variant for +1 for gating the |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When the tool set changes inside a live session (install/update/remove a plugin), the
agent loop appends a
developer/messagecarryingtool-addition/tool-removalblocks. The DeepSeek adapter converts those blocks into an inline system message:
{"role":"system","content":[{"type":"tool_addition","tool":{"type":"tool_reference","name":"ops_bash"}}]}The endpoint rejects the whole request:
Because the record is durable, every subsequent turn of that session fails the same
way — retry, restart and model switch do not help. On this machine 6 of 30 session
logs are poisoned (20 %), all of them triggered by installing/updating a plugin while
a session was open.
Code
dsh/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js:1241-1259No route/model capability check: the record is written for any model, including ones
that cannot express mid-conversation tool changes.
dsh/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js:559-560—MESSAGES_TOOL_CHANGES_BETA = "mid-conversation-tool-changes-2026-07-01":1638-1651—tool-addition/tool-removalblocks are serialized:1655-1658— pushed as{ role: "system", content: […] }into the message list:2216— theanthropic-betaheader is added only when such blocks are presentdsh/node_modules/@deepseek-ai/dsh-llm/lib/index.js:786-800already contains theopposite behaviour: when
toolUpdateisundefinedthe projection returnswithoutDeveloperMessages(messages), i.e. these blocks are stripped and the requestsucceeds. The adapter advertises
toolUpdate: "addition-only"for every built-inmodel (
:47-48), and there is no configuration surface that can clear it(
dsh-llm-deepseek-accountrejectsmodels, onlymodelOverridesexist and theymerge instead of delete).
Reproduction
deepseek-flash.dsh-opsfrom themarket).
400 … tool_addition blocks can only be in system messages; the same error isreturned for every later turn, in this and any future app run.
Session log evidence (v4 JSONL,
~/.dsh/sessions/<workspace>/<id>/session.v4.jsonl.zstd):Expected
when the route cannot express a mid-conversation change).
Suggested fixes
agent-loopon adapter capability(
preparedCall?.toolUpdate !== undefined), ordsh-llm-deepseek, when the model/route does not support the beta, droptool-addition/tool-removalblocks before serialization (reuse theprojectToolUpdatesfallback), instead of turning them into inline system messages.ignorable so later turns project it away.
Local workaround used
Offline log surgery: for each affected
developer/message, the tool-change blocks wereremoved and the paired
headerSeqdropped (the v4 admission rules requireheaderSeqto be absent when no
tool-additionblock remains), re-compressed frame-by-frame withchecksums.
seqstays dense and other rows stay byte-identical, so the session loadsand appends normally afterwards. Script:
fix_session_toolchange.mjsin the workspacethat produced this report.
All reactions