Repository navigation
feat: web UI model-switch column for session tables (#1557) - #1561
ranxianglei wants to merge 1 commit into
Conversation
[bot] 🏷 Review complete — the content is good, but this PR is a byte-identical duplicate of #1560. Closing this one; #1560 survives. Duplicate finding (why I'm closing this PR)Two daemon sessions picked up the same owner instruction in #1557 ("deliver it as its own PR branched off this branch's head") in parallel and produced two deliveries:
Verified: Review verdict (applies identically to both, since they're identical)① Direction — exactly what #1557 asked: the web hunks of #1540 restored onto #1558's head, referencing #1557. The zero-drift claim checks out: all 5 files are byte-identical between the pre-revert stacked head ② Existing-behavior inventory
③ Code — ④ Test validity — the new test is a real one, not a tautology: it pins the data path (fields omitted, not zero, for plain sessions), pins served-HTML alignment (13 headers == 13 colgroup cols on both tables, no stale colspan), and executes the actual ⑤ Diff — one linear commit, exactly the 5 named files, +230/−8, nothing else. Clean. Local verification (ran on head README coherence — confirmed: the combined branch's README already carries "gains a matching model-switch column" (line 898) and it's absent on master, so the doc sentence lands coherently with whichever of these PRs merges. Actions taken: closed #1561 as the duplicate of #1560 (tagged 中文摘要:审查通过——Web UI 模型切换列内容正确(5 文件 +230/−8、语义与已深审的 #1540 web hunks 逐字节一致、新测试为真测试、本地 typecheck + 全套 3054 项测试全绿、CI 全绿);但发现 #1560 与本 PR 的提交树完全相同(同一条 owner 指令被两个并行会话各交付了一次)。按重复合规处置:关闭本 PR #1561 并打「重复」标签,请改走先开的 #1560 合并。 |
Completes the Web UI portion of #1557, split out of #1558 per the owner instruction in #1557 ("deliver it as its own PR branched off this branch's head").
What
The sessions table (Sessions page) and the overview's recent list gain a Model Switches column: switch count · tokens re-billed after the switch, with tooltip; honest dash when none. Data is read-only from the per-session ledger agg (
agg.switches/agg.switchMissed) insummaryOf(); both JSON fields appear only whenswitches > 0.Files:
src/web/client.ts,src/web/i18n.ts,src/web/page.ts,src/web/sessions-data.ts,tests/web-sessions.test.ts(+230/−8).Semantics unchanged from the web hunks of #1540 (deep-reviewed there); applied onto the combined-stack head
3dc1358fwith zero drift (verifiedsrc/web/+tests/web-sessions.test.tsidentical between #1540's branch point and the combined head).Notes
/__bili/sessionsJSON gains two additive optional fields (modelSwitches,switchMissedTokens); existing consumers ignore unknown fields.2026-09-28_cache-attribution-combined(feat: combined cache attribution stack — model-switch drops, unmeasured quarantine, non-streaming settle (#1557) #1558). After feat: combined cache attribution stack — model-switch drops, unmeasured quarantine, non-streaming settle (#1557) #1558 merges, re-target/rebase to master before merging this one.Verification (head
670ec8c0, on top of #1558 head)