Repository navigation
feat(web+logs): sessions observability — model-switch column, version provenance, per-session log views - #1627
Merged
Conversation
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1578-pr.1627.8016608This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1627.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
ranxianglei
force-pushed
the
2026-09-29_web-sessions-observability
branch
from
September 29, 2026 00:49
88a8d90 to
02af5af
Compare
Supersedes PR #1560: its stacked base branch (2026-09-28_cache-attribution-combined) was squash-merged to master via #1558, leaving head cf81056 permanently CONFLICTING. This carries the byte-identical 5-file web delta (+230/-8, verified against stacked head a30ee8d) onto current master. The switch accounting it displays shipped in #1558.
- persist stamps metadata.biliVersion with the running build's version (provenance: which bili persisted this session); pre-stamp files simply lack the field - session detail card gains a 代理版本 row (honest dash for pre-stamp sessions) - boot line now reads 'acp-proxy vX.Y.Z listening ...' - every log line carries [v=x.y.z], so a multi-instance shared log self-identifies its writer per line - updates dsh-native / logger-epipe line-shape assertions for the new token
- AsyncLocalStorage funnel in startServer tags every line emitted while handling a model request with [sess=<id>] — zero changes across 264 log() call sites; one prefix per PHYSICAL line so multi-line stack traces keep attribution - GET /__bili/logs gains ctx=N (merged ±line context windows) and win=seconds (chronological window around first..last hit, interleaved lines kept) modes plus raw&all=1 unfiltered full-log download (rotated .old included, 100k cap); responses carry shown/omitted/isMatch - UI: context/window toggles (window wins), highlighted hit rows + dimmed context rows, truncation notice, dedicated full-log download button; filtered download keeps the active mode params - query logic in pure module src/web/logs-query.ts; tests: 10 unit cases + ALS tagging suite + in-process e2e (real startServer, mock upstream, tag grammar on disk and all three view modes over live HTTP)
ranxianglei
force-pushed
the
2026-09-29_web-sessions-observability
branch
from
September 29, 2026 00:58
a331232 to
8036f0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #1560
#1560's stacked base branch (
2026-09-28_cache-attribution-combined) was squash-merged to master via #1558, leaving its headcf81056permanently CONFLICTING. Commit 1 carries that PR's byte-identical 5-file web delta (+230/−8, verified against stacked heada30ee8d) onto current master. Please close #1560 when this lands.Three logical commits
1.
feat(web): model-switch cache drops column in web sessions viewSessions table gains a 模型切换/Switches column between hit% and folds:
count · missed-tokensfrom the ledgeragg.switches/agg.switchMissed(shipped in #1558), dim 「无」when never switched, fields omitted rather than zeroed. Includes live-endpoint test suite (rendered-DOM row-count check vianode:vm).2.
feat(version): make proxy version traceable on sessions and log linesmetadata.biliVersion(provenance: which build persisted the session) — pre-stamp files simply lack it, no backfill/fabricationacp-proxy v0.1.169 listening …[v=x.y.z]so a multi-instance sharedbili.logself-identifies its writer per linedsh-native/logger-epipeline-shape assertions updated for the token3.
feat(logs): per-session observability in the web log viewFixes the diagnosis pain point where the per-session log filter hid ~96% of warn/error lines (old format had no session field; only call sites that manually embedded an id matched):
startServertags every line emitted while handling a model request with[sess=<id>]— zero changes across the 264log()call sites; one prefix per PHYSICAL line so multi-line stack traces keep attributionGET /__bili/logsgainsctx=N(merged ±line context windows),win=seconds(chronological window around first..last hit, interleaving kept) andraw&all=1unfiltered full-log download (rotated.oldincluded, 100k-line cap); responses carryshown/omitted/isMatchsrc/web/logs-query.ts(+10 unit cases); new ALS tagging suite + in-process e2e (realstartServer, mock upstream)Verification
?q=<sid>&ctx=3: 115 hits → 776 rows incl. 661 previously-invisible context rows (other sessions' persist warns, 429 upstream lines, affinity hydrate)?q=<sid>&win=120: interleaved window view with hits highlightedraw&all=1: 12.2 MB / 72,364 lines == disk total (delta = concurrent writes during transfer); caught & fixed a real cap bug here (full download silently honored thelines=500default)Notes / caveats
[sess=…]lines already observed once newer instances picked up the tag — mix is visible by design in the shared log[session.id]in the message show the id twice alongside the auto tag — harmless, cosmetic[v=]costs12 bytes/line (+1 MB per 10 MB rotation)