Repository navigation
feat(web): full UI rewrite — read-only overview / sessions / config / connect (#1420) - #1426
Conversation
d8712b8 to
ee15bcd
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1419-pr.1426.634d563This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1426.tgz
npm install -g packageInstall instructions are refreshed on each push. |
ee15bcd to
f1953ef
Compare
Review complete — code checked out and diff-reviewed against #1420, rebased onto current master, full pre-flight re-run on the new head. What I did
① Direction vs original issueAll four asks of #1420 are covered: fresh UI (zero deps, no CDN refs — verified by scan; the only external URLs in ② Regression checklist (existing behaviors on touched paths)
③ Code review highlights
④ Test validity
⑤ Diff cleanliness10 files, every line related to this feature; no lock-file churn, no generated artifacts, no version bump, no whitespace noise. Working tree verified clean. Non-blocking observations (for this or the next phase — no action required to merge)
VerdictNo regressions found; behavior changes are disclosed and match the agreed phase plan. Mergeable — CI on the rebased head 中文摘要: 审查了 web UI 重写 PR(#1426,对应 #1420)——方向与原 issue 一致(本阶段只读配置、会话列表基于 export、全局统计+轨迹图齐备),对触碰路径逐项回归清点未发现回归(既有 API 全部不变、三个新路由都在 loopback+origin 门控内、i18n 严格一致性测试通过),代码与测试质量良好;发现 PR 落后 master 6 个提交且双方都改了 |
[bot] 🏷 收尾确认(接上一条完整 review): rebase 后的新头 中文摘要: web UI 重写 PR(#1426)审查完毕——方向与原 issue #1420 一致、回归清点无回归、代码与测试质量良好;已 rebase 到最新 master 并推送( |
…s-vs-net savings - drop position:sticky on table headers (they floated off the table mid-scroll) - context trajectory: start/end timestamps under the seq axis, hover tooltips on fold marks (fold n · time · S); fold economics table gains a time column - untitled sessions fall back to the first compression block's topic/summary lead - split the savings stat per acp-cache semantics: 'compressed savings (cumulative)' = sum(S-sigma)*requestsAfter + legacy estimates; 'net savings' subtracts measured re-pay and summary cost (ledger sessions only)
Color each sample's un-cached band (input minus cached) by its most likely cause — long idle gap with upstream TTL expiry (red), prefix rewritten by a compaction fold so the cache must be rebuilt (amber), cold start (gray) — with a per-sample hover tooltip carrying the full breakdown. Heuristics only need fields every ledger era stores (timestamps, input/cached, fold times), so older sessions without nc/cr/tr decomposition still get annotations.
…vings notes - trajectorySvg: first sample now resolves cold/new without touching lines[i-1] (resumed sessions start with cached>0 -> p=undefined -> page script died); also filter out null/sparse ledger lines defensively - loadDetail render wrapped in try/catch: a malformed session shows a warning card instead of an eternal spinner - overview: gross-savings card always explains its counting basis (per-fold savings x every later request, theoretical upper bound); net-savings card notes pre-tagging sessions without samples are excluded - i18n: ov.gross_note / ov.net_excl (zh+en); drop dead common.tokens
… draw system-prompt baseline, show client origin; fold table capped at 30; untitled blocks titled from summary lead
…ept verbatim in pre, line breaks preserved; chart legend swatches get real colors (TTL now purple)
…locks(.md) action
…ts.tokensSaved is no longer written); add client / cum. input / compression-count columns; per-block copy buttons + blocks copy-markdown action + title copy & hover-full-title
…folds cap 10 w/ scroll panel, structured handoff rendering
…obally and per protocol; add cache hit rate to session usage card
…every session row, the global hit card and session usage; folds table becomes one scroll panel
…te cost) visibly readable
…t in-card; drop the long footnote (full text moved to hover tooltip)
…mpty stub sessions (count shown), make wide tables scrollable
…r, download, copy path); detail identity links to a session's log lines
…lain routes/compress/passthrough; cache-report md copy+download on session detail; label==id treated as untitled
…wording for HTTP >= 400; single raw config-file editor replaces route/compress JSON boxes; plugin mode marked recommended with full 9-agent list; copy feedback on chip buttons
…ithout label swap; per-client launcher notes as hover tooltips
…ric columns centered; disk/restored badge tooltips; sample-trim note explains SAMPLE_CAP 512
… columns; selection-safe row clicks; negative net-savings tooltips; cache sample cap 512→4096
…itTd); per-protocol nc/cr/tr miss-drop pps in overview payload
…k or middle-click opens the session in a new tab; plain clicks navigate in-page as before
- plugin: webSessionUrl(origin, id) builds '<origin>/__bili/#/session/<id>'
- status panel gains 'Web UI: <url>' inserted ABOVE PANEL_BOX_FOOTER so the
strip-anchor (start+end signature) stays intact — zero model tokens
- tool acp-cache output prefixed with the same line before the report body
- server passes the real bound origin (0.0.0.0 -> localhost, socket.localPort)
d41ff14 to
709d444
Compare
|
复合回归问题 拉最新 |
…2219) The conflict surfaces told users WHAT happened (two compressors coexisting) plus the generic 'keep exactly one compressor' imperative, but no path to HOW — answering correctly required four separate doc locations, none linked from any surface (#917 board case: repeated unannounced-rewrite warnings, user had no idea what to do). Add a one-line per-client remediation hint keyed on the client identity already recorded at request time (#1426): - conflict-watch.ts: conflictClientOf() resolves pluginAgent ('mcp' falls through, #760b) then clientHint (exact scan-client names pass through; codex UA truncations normalize via isCodexClient); conflictRemediation() holds the opencode/claude/codex/pi/omp + generic map mirroring the doc anchors; CONFLICT_DOCS_POINTER. formatConflictSection() gains an optional client param and appends the Fix line + docs pointer; ConflictSummary gains clients[]. - acp_status passes this session's resolved client. - Web banner: one i18n line per distinct client (capped at 3, unknown -> generic, old payloads without clients[] degrade to generic only); session-detail card shows its own client's hint (new conflictClient field in the detail payload). - Launcher co-resident-plugin warning gains a 'fix (<client>)' line from the same map. - i18n zh+en conflict.hint.* keys; tests pin resolution, the map, the section suffix, clients[], i18n parity/drift, and web wiring. Guidance-only: detection gates/thresholds untouched (#2219 non-goal); no config surface changes.
…2219) The conflict surfaces told users WHAT happened (two compressors coexisting) plus the generic 'keep exactly one compressor' imperative, but no path to HOW — answering correctly required four separate doc locations, none linked from any surface (#917 board case: repeated unannounced-rewrite warnings, user had no idea what to do). Add a one-line per-client remediation hint keyed on the client identity already recorded at request time (#1426): - conflict-watch.ts: conflictClientOf() resolves pluginAgent ('mcp' falls through, #760b) then clientHint (exact scan-client names pass through; codex UA truncations normalize via isCodexClient); conflictRemediation() holds the opencode/claude/codex/pi/omp + generic map mirroring the doc anchors; CONFLICT_DOCS_POINTER. formatConflictSection() gains an optional client param and appends the Fix line + docs pointer; ConflictSummary gains clients[]. - acp_status passes this session's resolved client. - Web banner: one i18n line per distinct client (capped at 3, unknown -> generic, old payloads without clients[] degrade to generic only); session-detail card shows its own client's hint (new conflictClient field in the detail payload). - Launcher co-resident-plugin warning gains a 'fix (<client>)' line from the same map. - i18n zh+en conflict.hint.* keys; tests pin resolution, the map, the section suffix, clients[], i18n parity/drift, and web wiring. Guidance-only: detection gates/thresholds untouched (#2219 non-goal); no config surface changes.
…2219) The conflict surfaces told users WHAT happened (two compressors coexisting) plus the generic 'keep exactly one compressor' imperative, but no path to HOW — answering correctly required four separate doc locations, none linked from any surface (#917 board case: repeated unannounced-rewrite warnings, user had no idea what to do). Add a one-line per-client remediation hint keyed on the client identity already recorded at request time (#1426): - conflict-watch.ts: conflictClientOf() resolves pluginAgent ('mcp' falls through, #760b) then clientHint (exact scan-client names pass through; codex UA truncations normalize via isCodexClient); conflictRemediation() holds the opencode/claude/codex/pi/omp + generic map mirroring the doc anchors; CONFLICT_DOCS_POINTER. formatConflictSection() gains an optional client param and appends the Fix line + docs pointer; ConflictSummary gains clients[]. - acp_status passes this session's resolved client. - Web banner: one i18n line per distinct client (capped at 3, unknown -> generic, old payloads without clients[] degrade to generic only); session-detail card shows its own client's hint (new conflictClient field in the detail payload). - Launcher co-resident-plugin warning gains a 'fix (<client>)' line from the same map. - i18n zh+en conflict.hint.* keys; tests pin resolution, the map, the section suffix, clients[], i18n parity/drift, and web wiring. Guidance-only: detection gates/thresholds untouched (#2219 non-goal); no config surface changes.
…ion, one carrier, sticky binding (ranxianglei#1426) Single-rig proof of the mode-upgrade contract the two compression modes rely on: a session that grew and folded in proxy mode upgrades to plugin mode via x-bili-plugin without forking, keeps the proxy-era fold alive (preflight blocks carry acp_summary in any mode), stops tool injection exactly at the flip, executes a plugin-era fold through /__bili/plugin/ tool coexisting with the proxy-era block, refuses downgrade when the header disappears (sticky pluginAgent), lets a different agent header override the recorded value, and never latches destroy-escalation or conflict events on any sanctioned flip. Tooth verified: deleting the sticky-restore line in server/handle.ts fails the sticky phase.
…3769/#1567) The fold-gated sweep hid EVERY orphan-fate compress pair at/after the fold's start ref — including successful echoes whose call id never matched the server-minted block id. A re-sent pair quoting an ACTIVE block's range is the plugin lane's summary carrier (KDD#7), so hiding it strands the summary: the #1999 double-carrier test, the plugin session-lock e2e, #1426 mode-upgrade proof and #1638 notification pin all went red. resolveFate's 'orphan' verdict is id-based and cannot see success; the sweep branch now additionally requires the call to quote NO active block range (quotesActiveBlock: both arg shapes — content[] entries and flat top-level startId/endId — mirroring the host stripKernelSummaries carrier recognition). Genuinely failed records and dead-block pairs (swallowed by a wider fold) still sweep at the fold boundary, per the approved #3769 design.
…anxianglei#3769/ranxianglei#1567) The fold-gated sweep hid EVERY orphan-fate compress pair at/after the fold's start ref — including successful echoes whose call id never matched the server-minted block id. A re-sent pair quoting an ACTIVE block's range is the plugin lane's summary carrier (KDD#7), so hiding it strands the summary: the ranxianglei#1999 double-carrier test, the plugin session-lock e2e, ranxianglei#1426 mode-upgrade proof and ranxianglei#1638 notification pin all went red. resolveFate's 'orphan' verdict is id-based and cannot see success; the sweep branch now additionally requires the call to quote NO active block range (quotesActiveBlock: both arg shapes — content[] entries and flat top-level startId/endId — mirroring the host stripKernelSummaries carrier recognition). Genuinely failed records and dead-block pairs (swallowed by a wider fold) still sweep at the fold boundary, per the approved ranxianglei#3769 design.
Closes #1420
Complete rewrite of the built-in web UI (
src/web/) per the issue: fresh design (ework-web-inspired light/dark cards + tabs), zero dependencies, no CDN assets. This phase is read-only per issue point 2 — config editing comes next phase.What's new
4 pages (hash-routed, no full reloads):
/acp-cacheuses), cache economics (newContent/compRepay/ttlRepay/residual + fold table), compression blocks, and the rendered handoff document (thebili exportcontent, safe server-side markdown→HTML).preserveRecentTools/neverPreserveRecentToolsentries), passthrough state; upstream probe button kept.New endpoints (loopback-gated like all other
/__bili/*routes)GET /__bili/overview— global aggregation + status fields (incl.conflicts, porting 自动识别其他压缩插件存在并在任何可能的情况下报告警告 #1206's data into the new shell)GET /__bili/sessions— merged live+disk session listGET /__bili/sessions/<id>/detail— per-session stats/blocks/ledger/handoff HTMLDisk scan uses a memoized full-store load with a 5 s TTL (cheap at 5 s poll cadence); strictly read-only.
Behavior changes (flagged per policy)
PUT /__bili/config,POST /__bili/upstream/test, passthrough override clearing via API all still work exactly as before — only the UI controls were removed for this phase.localStorage bili-language).conflict.on/conflict.desc+data.conflictshandling, now also served by/__bili/overview) and feat: neverPreserveRecentTools config knob (acp-kernel 0.0.92) #1332-review compress-key glossary strings.Tests & pre-flight (on rebased head)
tests/web-i18n.test.tsunmodified, passes (strict catalog parity / dead-key / DOM coverage rules)tests/web-routing.test.ts: 2 assertions updated for the read-only phase (no<textarea>/save buttons); all API round-trip tests untouchedtests/web-sessions.test.ts(6 tests): markdown XSS safety, live+disk merge & precedence, overview aggregation math, detail payload, endpoint wiring incl. 404