diff --git a/.github/workflows/bridge-session-summary.yml b/.github/workflows/bridge-session-summary.yml index 5ec80bdd..c559d7c9 100644 --- a/.github/workflows/bridge-session-summary.yml +++ b/.github/workflows/bridge-session-summary.yml @@ -8,8 +8,8 @@ name: Generate Session Summary for Notion on: schedule: - - cron: '50 23 * * *' - - cron: '50 14 * * *' + - cron: '50 23 * * *' # 07:50 Beijing Time + - cron: '50 14 * * *' # 22:50 Beijing Time workflow_dispatch: permissions: diff --git a/docs/index.html b/docs/index.html index ffe56efe..a33bfcfe 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1579,14 +1579,14 @@ function trimMessagesForContext(sysMsgs, msgs, isGuest){ const reserve = CONTEXT_CONFIG.systemPromptReserve; const sysTokens = sysMsgs.reduce((n,m)=>n+estimateTokens(m.content),0); const budget = limit - Math.max(sysTokens, reserve); - if(budget<=0) return sysMsgs; // 从最新消息向前累加,滑动窗口裁剪最早消息 + // 预算不足时至少保留最近一条用户消息 const kept=[]; let used=0; for(let i=msgs.length-1;i>=0;i--){ const t=estimateTokens(msgs[i].content); - if(used+t>budget) break; + if(used+t>budget && kept.length>0) break; kept.unshift(msgs[i]); used+=t; }