發佈 0.1.12:會話模式新增「每則獨立」,ctx 達 80% 自動開新會話

根本原因:
會話越用越慢——每張生成圖都會塞回上下文,實測同一會話從 36 秒
一路漲到 135 秒,也更容易在串流時被切斷。

修法:
1. 會話模式 sharedSession 布林改為 sessionMode(per-chat / shared / stateless),
   stateless = 每則訊息獨立、不保留記憶,適合單張生圖這類不需上下文的 bot;
   舊設定檔的 sharedSession 自動相容轉換。
2. 新增 autoResetCtxPercent(預設 80):任一會話上下文用量達門檻即自動
   開新會話並在回覆末尾提示,避免無限累積。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-17 16:18:33 +08:00
co-authored by Claude Fable 5
parent cfa61aa01a
commit 24c66130d0
5 changed files with 54 additions and 25 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "telegram-codex-bot",
"version": "0.1.11",
"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",