t161+t162 修 leo prod 實撞兩病:庫清單靜默空白/「需要更新」假警報迴圈
t162(假警報,實錘):daemon cloudVersionStale() 讀 cypher /health 的 bundle_version
比對 minCloudBuilt(2026-07-28),但 **/health 從來只回 {ok:true}、沒有這個欄位**
⇒ 恆讀到空字串 ⇒ 恆判 stale ⇒ 「知識庫需要更新」永遠不消失,重裝也沒用
(leo:「按下就跳到 install,但重新更新後並不會消失,這個訊息是幹嘛的?」)。
安裝器其實一直有注入 ARCRUN_BUNDLE_VERSION(worker.js:819),只是沒人吐出來。
修:/health 讀該 var 誠實回報(未注入則省略欄位=老實例,daemon 判 stale 是對的)。
新 bundle 注入值 2026-07-31+<commit7> ≥ 2026-07-28 ⇒ 重裝後警報自然消失。
t161(庫清單空白):portal 前端 guard401 → dropSession() **靜默**清 token 跳登入頁,
畫面不說任何原因 ⇒ 用戶看到的是「庫不見了」而非「請重新登入」(leo:「實際上根本
沒連上任何庫,清單空白」)。修:dropSession 帶原因寫進 #login-status——
「你的登入已過期,請重新登入(你的資料都還在,不會遺失)。」
資料側無恙(portal_library records=2 已驗),純讀側 session 過期+靜默 UX 缺陷。
驗:cypher tsc 全綠;vitest 9 failed/187 passed=基線不變。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -674,11 +674,19 @@ function taipeiMonthDay(ms) { var d = new Date(ms + TAIPEI_OFFSET_MS); return {
|
|||||||
if (!location.hash) location.hash = '#/' + HOME;
|
if (!location.hash) location.hash = '#/' + HOME;
|
||||||
route();
|
route();
|
||||||
}
|
}
|
||||||
function dropSession() {
|
// t161(leo 07-31 實撞:「實際上根本沒連上任何庫,清單空白」):session 過期時
|
||||||
|
// 舊行為=靜默清 token 跳回登入頁,**畫面不說任何原因** ⇒ 用戶以為「庫不見了/系統壞了」。
|
||||||
|
// 友善=前端:踢回登入頁時一定要說「為什麼」,用戶才知道下一步做什麼(重新登入即可,資料都在)。
|
||||||
|
function dropSession(reason) {
|
||||||
S.token = '';
|
S.token = '';
|
||||||
S.profile = null;
|
S.profile = null;
|
||||||
try { localStorage.removeItem('arcrun_portal_session'); } catch (e) { /* noop */ }
|
try { localStorage.removeItem('arcrun_portal_session'); } catch (e) { /* noop */ }
|
||||||
showAuth();
|
showAuth();
|
||||||
|
var msg = reason || '你的登入已過期,請重新登入(你的資料都還在,不會遺失)。';
|
||||||
|
try {
|
||||||
|
var el = $('login-status');
|
||||||
|
if (el) el.textContent = msg;
|
||||||
|
} catch (e) { /* 登入殼還沒渲染就算了 */ }
|
||||||
}
|
}
|
||||||
function boot() {
|
function boot() {
|
||||||
if (!S.token) { showAuth(); return; }
|
if (!S.token) { showAuth(); return; }
|
||||||
|
|||||||
@@ -3,9 +3,19 @@ import type { Bindings } from '../types';
|
|||||||
|
|
||||||
export const healthRouter = new Hono<{ Bindings: Bindings }>();
|
export const healthRouter = new Hono<{ Bindings: Bindings }>();
|
||||||
|
|
||||||
healthRouter.get('/health', (c) =>
|
// t162(leo 07-31 實撞:「小幫手一直顯示知識庫需要更新…重新更新後並不會消失」):
|
||||||
c.json({ ok: true })
|
// daemon cloudVersionStale() 讀 /health 的 `bundle_version` 判斷是否過舊——
|
||||||
);
|
// 但本端點過去只回 {ok:true},**從沒吐這個欄位** ⇒ daemon 恆讀到空字串
|
||||||
|
// ⇒ 恆判 stale ⇒ 假警報永遠不消失(安裝器其實一直有注入 ARCRUN_BUNDLE_VERSION var,
|
||||||
|
// 只是沒有人把它吐出來)。修=誠實回報本實例的 bundle 版本。
|
||||||
|
// 未注入(本地 dev/很舊的實例)就省略該欄——daemon 對空字串仍判 stale,
|
||||||
|
// 那是**正確的**(真的是老實例,該更新)。
|
||||||
|
healthRouter.get('/health', (c) => {
|
||||||
|
const bundleVersion = c.env.ARCRUN_BUNDLE_VERSION;
|
||||||
|
return c.json(
|
||||||
|
bundleVersion ? { ok: true, bundle_version: bundleVersion } : { ok: true },
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
healthRouter.get('/', (c) =>
|
healthRouter.get('/', (c) =>
|
||||||
c.json({
|
c.json({
|
||||||
|
|||||||
@@ -68,6 +68,13 @@ export type Bindings = {
|
|||||||
// 必填:cypher-executor 用此組出 component worker URL(避開同 zone 自循環死鎖,見 P0 #9)
|
// 必填:cypher-executor 用此組出 component worker URL(避開同 zone 自循環死鎖,見 P0 #9)
|
||||||
// self-hosted fork 必須改 wrangler.toml [vars] 為自己的帳號 subdomain
|
// self-hosted fork 必須改 wrangler.toml [vars] 為自己的帳號 subdomain
|
||||||
WORKER_SUBDOMAIN: string;
|
WORKER_SUBDOMAIN: string;
|
||||||
|
/**
|
||||||
|
* t162:本實例安裝時的 bundle 版本(格式 `YYYY-MM-DD+<commit7>`)。
|
||||||
|
* 由安裝器 deployBundledWorker 注入(worker.js:805),**給 daemon 比對用**——
|
||||||
|
* daemon `/health` 讀不到就恆判「需要更新」(假警報迴圈,leo 07-31 實撞)。
|
||||||
|
* 未注入(本地 dev/舊實例)= undefined,/health 省略該欄。
|
||||||
|
*/
|
||||||
|
ARCRUN_BUNDLE_VERSION?: string;
|
||||||
// Platform telemetry api_key(可選,wrangler secret)
|
// Platform telemetry api_key(可選,wrangler secret)
|
||||||
// 對應 SDD .agents/specs/llm-interface/ M1.2
|
// 對應 SDD .agents/specs/llm-interface/ M1.2
|
||||||
// 設了會把 agent-telemetry block 都聚集在 platform_telemetry user_id 下
|
// 設了會把 agent-telemetry block 都聚集在 platform_telemetry user_id 下
|
||||||
|
|||||||
Reference in New Issue
Block a user