Repository navigation
[Bug] Local Ollama models answer injected runtime/skill/time context instead of the user's task, so no tool is ever called (0.2.1-rc.2) #10080
Replies: 1 comment
|
For anyone hitting this: the ordering can be corrected from a plugin today, with no core change — I built one for this thread.
Install (npm publication is still pending; the repository carries its compiled output, so a git install runs no build step): dsh plugin add github:argszero/dsh-human-request-lastKnobs: What it guarantees: a batch carrying at least one human message and at least one injected message comes back with the injected messages first and the human messages last, each group in its original order; an unchanged batch is returned as the same object (no copy, no extra token); a step with no human message — a wake or continuation step, where the injections are the input — is left untouched. The rewrite is durable rather than cosmetic, because the loop appends Scope, stated plainly: this is a fix at the batch boundary, not the upstream fix. Moving the runtime snapshot before the claimed input at the source, or sending source-attributed context as |
Uh oh!
There was an error while loading. Please reload this page.
Summary
With an Ollama (OpenAI-compatible) provider, a simple file-editing request never produces a tool call. Before generation DSH appends three injected context snapshots —
runtime-context,skill-catalog,time-context— after the real human message, all withrole: "user". Small local models treat the lastusermessage as the current request:gpt-oss:20bexplains the timestamp fromtime-context,qwen3:8backnowledges the skill catalog. The file is never read or edited.This is not a sandbox or tool-execution failure: the tools are in the request,
toolMsis0, and the assistant message has notool-callblock.Environment
0.2.1-rc.2(also seen on0.2.0-rc.2), viadsh web0.35.1, endpointhttp://127.0.0.1:11434/v1gpt-oss:20b(MXFP4),qwen3:8b(Q4_K_M)v24.15.0workspace-writeProvider config (excerpt of
~/.dsh/profiles/web/cordis.patch.yml):Same result when launched with
ollama launch dsh --model gpt-oss:20b.Reproduction
Configure the Ollama provider above.
Create a new session: Standard preset,
workspace-write, modelgpt-oss:20b.Make sure
test.mdexists in the workspace.Send (the original request was in Chinese; English translation below it):
The model calls no tool and replies about the injected timestamp.
test.mdis unchanged.Happens in fresh sessions every time I tried.
Current behavior
Session events for turn 1:
source.kindsystem/messageuser/messageuseruser/messageruntime-contextCurrent runtime context. This snapshot supersedes earlier runtime-context snapshots...user/messageskill-catalog<system-reminder> A skill is a reusable set of task-specific instructions...user/messagetime-contextTime sampled while preparing turn 1, step 1: <timestamp>...request/headerread,edit,write,glob,grep,pwsh,skillrequest/contextassistant/messagereasoning+textonly, notool-callturn/endreason.kind: "completed"seq 8–11 all have
"role": "user". Example (seq 11, trimmed):{"type":"user/message","seq":11,"data":{"role":"user","source":{"kind":"time-context","form":"snapshot"},"content":[{"type":"text","text":"Time sampled while preparing turn 1, step 1: <timestamp>..."}]}}The reasoning at seq 17 shows the model took seq 11 as the user's message:
The final reply only converts the timestamp to UTC (
The timestamp you provided, <timestamp>, denotes the moment of ...), and the turn ends ascompleted. Session stats:"toolMs": 0, "pendingCalls": {}.The session title, generated by the same model from the same human message, was correct ("test.md 内容替换" / "replace test.md contents"), so the model understood the request when it was the only message it saw.
Which injected message the model latches onto depends on the model:
gpt-oss:20b: answers the finaltime-contextsnapshot.qwen3:8b:I've received the system reminder about the available skills. I'm ready to assist..., orThe user hasn't asked a question yet. No action needed.Expected behavior
The human message (seq 8) is the active task, giving roughly
read(test.md)→edit/write(test.md)→ final reply. Injected snapshots should not look to the model like a newer user request.Where the ordering comes from
Checked on master
687f282(2026-10-17):agent-loop/src/agent.tspreStep()returns[...claimed, context], so the runtime-context snapshot goes after the claimed human message.runtime-context.tsproject()builds that snapshot withcreateUserMessage.time-context/src/index.tsappends anothercreateUserMessageafterdecision.messages.llm-pi-ai/src/context.ts(and L366-L371) sends every remaining harness message asrole: 'user'without looking atsource.kind.So
source.kindseparates injected context from human input inside DSH, but on the OpenAI-compatible route the model just sees four consecutiveusermessages with the real request first and a timestamp last.Possible fixes
user.Tried, did not help
qwen3:8b→gpt-oss:20bworkspace-writedsh webandollama launch dsh --model gpt-oss:20b0.2.0-rc.2→0.2.1-rc.2curl.exe http://127.0.0.1:11434/v1/modelslists the installed models, so the endpoint itself is fine.time-contextwith a partialpreset-standardprofile override failed withagent-preset/not-found: Unknown agent preset: standard(override reverted; no files inside the installed package were edited). If there is a supported way to turn offtime-context/skill-catalogper provider, that would be a useful workaround.Related
usermessage, the skill catalog, instead of the task), claude-opus-5 on 0.1.1-rc.2Attachments
Attached (redacted: username and workspace path replaced with placeholders, time zone removed):
session-debug-full.redacted.jsonl.txt— the full session log for the turn above (one JSON event per line;.txtadded so GitHub accepts the upload)critical-events.redacted.txt— the key events (seq 7–13 and 17) pretty-printedinjection-search.redacted.txt— whereruntime-context/skill-catalog/time-contextare produced in the installed 0.2.1-rc.2 packageThe original
session.v4.jsonl.zstdis available if needed.All reactions