根本原因: imagegen 產圖成功後,模型把含圖結果串流回來時 OpenAI 端偶發切斷 WebSocket(stream disconnected / websocket closed),codex 回報 turn.failed, bot 視為致命錯誤,連已生好的圖一起丟掉,使用者只看到錯誤。 修法: 1. codex.js 失敗時附帶 threadId 與 transient 旗標(辨識暫時性連線錯誤)。 2. bot.js 改為重試迴圈:暫時性錯誤時,若本輪 generated_images 已有產圖, 直接交付並註明「連線中斷但圖已生成」,不重跑(避免重複生圖); 沒產出才 resume 同一會話重試一次,狀態訊息顯示「自動重試中」。 會話失效/換模型的自動開新會話邏輯併入同一迴圈。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
42 lines
867 B
JSON
42 lines
867 B
JSON
{
|
|
"name": "telegram-codex-bot",
|
|
"version": "0.1.11",
|
|
"description": "Telegram bot powered by the local Codex CLI — zero-dependency, pm2-managed, with a built-in PM2 web viewer",
|
|
"license": "MIT",
|
|
"type": "commonjs",
|
|
"publishConfig": {
|
|
"registry": "https://jianmiau.ddns.net/api/packages/AI/npm/"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "ssh://git@jianmiau.ddns.net:8022/AI/telegram-codex-bot.git"
|
|
},
|
|
"main": "src/index.js",
|
|
"bin": {
|
|
"telegram-codex-bot": "bin/cli.js",
|
|
"tgcodex": "bin/cli.js"
|
|
},
|
|
"files": [
|
|
"bin/",
|
|
"src/",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"engines": {
|
|
"node": ">=18"
|
|
},
|
|
"scripts": {
|
|
"start": "node bin/cli.js web",
|
|
"dev": "node --watch src/web/server.js"
|
|
},
|
|
"keywords": [
|
|
"telegram",
|
|
"bot",
|
|
"codex",
|
|
"codex-cli",
|
|
"pm2",
|
|
"ai",
|
|
"agent"
|
|
]
|
|
}
|