Repository navigation
Replies: 1 comment
|
@wutyi4330 — you already named the gap yourself: I would put the general form wider than one limit: the constraint was declared as data, and nothing executes at the moment it is reached. That gives a check that does not wait for the next report: enumerate the constraints the runtime declares — budgets, caps, windows — and for each ask whether any code path executes where it is hit. A declared constraint with no execution point is data, not a rule, and from the caller's side the two are indistinguishable. I wrote the general form up, with both instances, in our own thread here: discussioncomment-19400984. Authorship note: drafting assisted by AI; verification and publication by me. I have no engineering background — if any technical claim reads wrong, please call it out and I will re-verify and correct. Reported by the OfferKuai Team (Offer快) — Founder: Zhaofeng (Yaming). Website: https://www.offerkuai.com/. Contact: contact@offerkuai.com 中文版@wutyi4330 —— 这一格你自己已经点出来了: 我想把一般化的形式说得比"某个上限"更宽:约束被声明成了数据,而在它被触及的那一刻,没有任何东西执行。 由此得到一条不必等下一份报告的自查:把运行时声明出来的约束 —— 预算、上限、窗口 —— 列一遍,逐个问:它被触及的那一刻,有没有代码在那里执行? 声明了却没有执行点的约束是数据,不是规矩;而在调用方看来,这两者不可分辨。 一般化形式连同两个实例,我写在自己那篇帖子里:discussioncomment-19400984。 声明:文稿撰写由 AI 协助完成;核验与发布由我本人负责。我非工程背景 —— 若任何技术表述有误,请直接指出,我会对照工具链重新核实并更正。 本报告由 OfferKuai(Offer快)团队 提交 —— 创始人:Zhaofeng(Yaming)。官网:https://www.offerkuai.com/。联系:contact@offerkuai.com |
Uh oh!
There was an error while loading. Please reload this page.
Bug Report: Agent turns silently truncated on
finish_reason=length— no auto-continuation, turn marked as completedEnvironment
runtime-dsh-0.1.2-rc.1@deepseek-ai/dsh-agent-loop(lib/index.js)Summary
When a single model response hits the max-tokens limit (
finish.kind === "max-tokens"),the agent-loop ends the turn immediately via the normal completion path. No
auto-continuation is attempted, no compaction-and-retry is triggered, and the UI
reports the turn as successfully completed — even though the assistant's output
was cut off mid-sentence / mid-tool-call.
This makes long coding sessions silently lose work: the agent appears to "finish"
but its final message (or a tool call it was about to make) is truncated. The user
experience is "the assistant suddenly stopped and claimed it was done."
Evidence (from dsh-agent-loop/lib/index.js, 0.1.2-rc.1)
Step level — truncation short-circuits to a return:
Turn level — the truncation result ends the loop when no queued inbox messages exist:
Because the turn ends via
break(not theerror/abortedpaths), downstreamlifecycle treats it as a normal completion → UI shows "done".
dsh-compactionexists but is a pre-emptive context-budget compaction("providers decide when to compact"). It does not cover the
single-response-truncated case, so nothing rescues a max-tokens cut.
Why it surfaced recently
coding loops) hit the per-response max-tokens ceiling far more often.
making truncation frequent.
Expected behavior
On
finish.kind === "max-tokens", DSH should automatically recover, e.g. either:preserved (append-only continuation, possibly with a "continue" user nudge),
repeating until the model finishes naturally; or
own (
finish.kind === "completed"/ no pending tool calls).Suggested fix sketch
In the turn loop, treat
max-tokenslike "more work pending":Guard with a max-continuation counter to avoid pathological loops.
Impact
Metadata
once the output budget is exceeded.
All reactions