fix(chat): default reasoning fold on for new browsers and bump chat.js cache

The reasoning/tool collapsed bundle is gated by adminChatShowToolOutput,
which was only read from localStorage with default false. A fresh browser
therefore hid persisted reasoning in the fold while streaming still showed
tokens. Default to true and bump chat.html asset version so deployments pick
up the script.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-12 20:29:58 +08:00
parent a3365b77fa
commit c938147fdb
2 changed files with 3 additions and 2 deletions

View file

@ -574,7 +574,7 @@
<script defer src="/admin/assets/admin-theme.js"></script>
<script
defer
src="/admin/assets/chat.js?v=20260510-2"
src="/admin/assets/chat.js?v=20260511-1"
onerror="(function(){var s=document.getElementById('chat-boot-splash');if(s){s.querySelector('.chat-boot-splash__title span:last-child').textContent='无法加载 chat.js';s.querySelector('.chat-boot-splash__muted').textContent='请确认网关已启动且 /admin/assets/chat.js 可访问。';}})()"
></script>
</head>

View file

@ -384,7 +384,8 @@ const CONFIRM_STRATEGY_AUTO = "auto";
const CONFIRM_STRATEGY_OFF = "off";
const PLAN_AGENT_V1 = "v1";
const PLAN_AGENT_V2 = "v2";
const ADMIN_CHAT_SHOW_TOOL_OUTPUT_DEFAULT = false;
/** Default on: reasoning/tool fold matches streamed behavior; new browsers have no localStorage yet. */
const ADMIN_CHAT_SHOW_TOOL_OUTPUT_DEFAULT = true;
const REASONING_BLOCK_MAX_CHARS = 12000;
const CHAT_ENABLE_WIKI_EVENT_POLLER = false;
const _rt = String(localStorage.getItem(CHAT_REASONING_TOGGLE_KEY) || "").trim().toLowerCase();