You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: code run failed (exception): Expected '(', got 'ident'
Error: code run failed (exception): 'import', and 'export' cannot be used outside of module code
Error: code run failed (exception): ReferenceError: require is not defined
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
环境
@deepseek-ai/dsh(web profile),2026-08-16/17,Windows 11。agentPreset=code(code-only 模式),模型 ring(经本地 OpenAI 兼容网关,reasoningEffort=max)。现象 1:code-only 拒绝信息不给恢复路径
直接调用任何工具(read / write / pwsh / Bash / MCP 搜索)都会返回:
模型反复收到同类拒绝后仍不断尝试直接调用。实测一次会话(23:36 → 00:25,约 49 分钟)内出现 70+ 次工具调用,绝大多数是"直接调用被拒 → 猜绑定名 → 猜错"的循环。拒绝消息里没有"run_code 内到底有哪些绑定、如何列出"的线索。
现象 2:run_code 的语言/形态错误不说明环境
模型把
code写成 Python 或 CommonJS 时,报错只有裸语法错误:均未指出"code 必须是 TypeScript async 函数体、没有 require/import/fs"。模型因此反复在 Python / JS / 路径转义之间换写法,空转 20+ 分钟。
现象 3:绑定名猜错与配置错误没有可行动提示
run_code 内调用不存在的绑定(如
tools.pwsh)报ReferenceError: xxx is not defined;web_search报:模型不知道真实绑定名,也不知道该改哪个配置键,只能反复重试或继续猜。
建议
inside run_code, run: return Object.keys(tools).sort(),或直接列出当前可用绑定名。await tools.xxx调用)。require(、import或 Python 语法特征时,返回专门提示,而不是裸语法错误。agent-default-model.provider或 web provider 配置键)与候选 provider 列表。复现轨迹(节选)
最终产物文件被一个 run_code 程序截成 0 字节,任务失败。
备注
$DSH_HOME/AGENTS.md教模型先Object.keys(tools)枚举、遇到同类错误立即换思路;仍希望框架层从错误信息上根本缓解。All reactions