根本原因: 會話越用越慢——每張生成圖都會塞回上下文,實測同一會話從 36 秒 一路漲到 135 秒,也更容易在串流時被切斷。 修法: 1. 會話模式 sharedSession 布林改為 sessionMode(per-chat / shared / stateless), stateless = 每則訊息獨立、不保留記憶,適合單張生圖這類不需上下文的 bot; 舊設定檔的 sharedSession 自動相容轉換。 2. 新增 autoResetCtxPercent(預設 80):任一會話上下文用量達門檻即自動 開新會話並在回覆末尾提示,避免無限累積。 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.12",
|
|
"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"
|
|
]
|
|
}
|