Bot pinned to an engine whose CLI is not installed fails every turn with no error message
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 56/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend
调研方向
Start in dist-server/server/drivers/pi.js at the child process close handler and compare it with the describeSpawnFailure path. Trace how settle(false) and bot.turn.end reach the chat, then check the related driver tests or add a regression test for a child that exits before the handshake. Done means the failure appears as a visible error in chat.
由索引模型根据 Issue 内容生成。
描述
What happened
An engine can be saved in config.json (and even be the default model selection) while its CLI is not installed on the machine. Bots pinned to that engine then fail every turn, and the only trace is bot.turn.end ok:false in the trail log — the chat shows the person's message, then a [digest] · no tool activity, with no error text and no "install this engine" prompt. The bot looks like it ignored the message.
Expected: either the send is refused with the engine's own explanation, or the turn fails with a visible message — the same one GET /api/instances already produces:
piisn't installed, or isn't on this app's PATH. Install it for the user running dusk bot or use Set CLI, then check again.
Actual: the turn is accepted (POST /api/bots/<id>/messages → 202) and dies in a few hundred ms:
{"ev":"bot.turn.start","provider":"piAgent","turn":"ae7aab35-…"}
{"ev":"bot.turn.end","ok":false,"stop":"failed","ms":479}
No runtime.error event, nothing in logs/trail-server.jsonl, nothing in the chat.
Steps to reproduce
-
Have a
piengine saved with nopibinary installed for the user running dusk bot:"instances": { "pi": { "driver": "piAgent" } }, "defaultModelSelection": { "instanceId": "pi", "model": "opencode-go/hy4-flash-free" } -
Point a bot at it:
"modelSelection": { "instanceId": "pi", "model": "opencode-go/hy4-flash-free" } -
Send the bot any message.
Version
duskbot 0.2.12 (pi 1.5.2)
Platform
Linux (Ubuntu on WSL2), DUSK_BOT_BOX=required
Engine
pi (piAgent driver)
Logs or screenshots
Trail log for the failing turn — the only record of the failure:
{"ev":"bot.turn.start","provider":"piAgent","turn":"ae7aab35-…"}
{"ev":"bot.turn.end","ok":false,"stop":"failed","ms":479}
Why it is silent
In dist-server/server/drivers/pi.js the spawn failure path emits a runtime.error (describeSpawnFailure), but a child that exits during startup lands in the close handler:
child.on("close", () => {
rejectWaiters(new Error("pi process exited before replying"));
settle(false); // → stopReason "failed", no runtime.error emitted
});
settle(false) yields stopReason: "failed" with no message, so the failure never reaches the UI. Other drivers surface their failures in the chat; this path cannot.
Suggested fix
- In the
closehandler, emit aruntime.error(and abot.turn.endmessage) when the child exits before the handshake, e.g.describeSpawnFailureplus "the engine exited before it answered". - Optionally, refuse the send up front when the selected instance's snapshot is
unavailable, and reuse that snapshot'sreasonas the chat message.
Related pi-driver issues found while diagnosing the same turn
Both are fixable on this side; happy to file separately.
- The driver writes its per-turn MCP config under
TMPDIRand passes it asDUSK_MCP_CONFIG. The bot box replaces/tmpwith a private tmpfs, so the file is invisible to the boxed engine and the extension throwsdusk bot Pi MCP configuration could not be readbefore any RPC frame is sent. - The box runs the engine with
HOME=<data>/engine-home, into which only~/.pi/agent/auth.jsonis shared (ENGINE_FOLDERS), notmodels-store.json. The model list is then empty andset_modelanswersModel not found: opencode-go/hy4-flash-free, whileGET /api/instancesreports the same engine asavailablewith 34 models — the engine probe runs in the server's HOME, the turn does not.
- 主要语言
- TypeScript
- 星标
- 277
- 派生
- 27
- 平均合并
- 2 小时 47 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DuskBotAI/duskbot 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 63/100
维护者通常 1 天内回复
-
After uninstalling an own server, the desktop app stays on it and shows Cloudflare's Error 1033 page未关闭
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 1 天内回复
-
install.sh --tailscale replaces whatever the host already serves on tailnet port 443可能已有人在做 @viniciusbregoli 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
查看 DuskBotAI/duskbot 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
inabagumi/shinju-date#7406 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
umami-software/umami#4787 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复