Repository navigation
fix: 运行中会话的详情面板不再误显示 legacy(仅 JSON)存储与版本 —(自 #3093) - #3094
Merged
Merged
Conversation
The web detail panel read running (never-persisted) sessions straight from memory, where session.metadata never carried the provenance stamps — those were only applied to disk records in buildRecord. The frontend then fell back to legacy/"—" for every live session regardless of the real storage mode. Stamp both fields in createSession (the single choke point for new in-memory sessions); buildRecord re-stamps identical values on save so disk records are byte-identical, and canonical.ts already masks/drops these keys so digests are undisturbed.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3524-pr.3094.de89f54This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3094.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.397-master.6887bbd # this exact build
npm install -g billion-context@master # always the newest merged build
|
ranxianglei
pushed a commit
that referenced
this pull request
Oct 14, 2026
The unused-exports gate (#1440 P6) fails on this branch: ReportOpts/ReportData/SvgReport in src/web/report.ts are only referenced within their own file yet declared as exports. Drop the leading 'export' per the gate's prescribed INTERNAL_ONLY fix. No behavior change: admin.ts and the tests import only the two buildSessionReport* functions. Branch also rebased onto current master (6887bbd, +#3094; no file overlap with this PR). Found while reviewing #3099.
This was referenced Oct 14, 2026
ranxianglei
pushed a commit
that referenced
this pull request
Oct 14, 2026
The unused-exports gate (#1440 P6) fails on this branch: ReportOpts/ReportData/SvgReport in src/web/report.ts are only referenced within their own file yet declared as exports. Drop the leading 'export' per the gate's prescribed INTERNAL_ONLY fix. No behavior change: admin.ts and the tests import only the two buildSessionReport* functions. Branch also rebased onto current master (6887bbd, +#3094; no file overlap with this PR). Found while reviewing #3099.
This was referenced Oct 14, 2026
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.
Closes #3093
修的是什么
溯源章(
biliVersion/storageMode)以前只盖在落盘记录上(persist.ts buildRecord);内存里的活会话对象永远没有这两个字段。详情接口对运行中会话直接取内存对象(sessions-data.ts buildSessionDetail,内存命中就不走盘),响应里缺章,前端 fallback 成legacy(仅 JSON)+ 版本———无论实际是 full 还是 shadow。落盘/重启后从盘恢复才正常。修法(issue 推荐方案 A)
会话创建的唯一入口
createSession直接把两个章盖进内存session.metadata:src/session.ts:metadata: {}→metadata: { biliVersion: VERSION, storageMode: effectiveFileStorageMode() }(存储模式是进程级常量,创建时盖章即终身正确);src/persist.ts:导出既有的effectiveFileStorageMode()(零逻辑变更);tests/web-sessions.test.ts:新增回归测试——从未落盘的运行中会话,内存 metadata 必须带两章、详情接口必须返回它们。无修复时红、有修复时绿(已双向验证)。行为变更披露
biliVersion/storageMode字段(以前缺失 → 前端显示 legacy + —)。这正是本 bug 的预期修复。buildRecord的展开+显式覆盖输出与之前字节一致(Storage layer: four concrete defects (filename coupling, multi-writer heuristic, non-atomic content-store write, immortal compressed sessions) #2671 既有落盘章测试全部通过)。biliVersion值掩码为__VER__、对storageMode整键丢弃,活会话 metadata 多这两个键不改变 digest。验证
npm run typecheckclean;tests/web-sessions.test.ts24/24 通过(含新测试);persist-stats-roundtrip/storage-corpus/proxy-persist/session-transient-memory/subagent-sessions合计 45 例中 43 通过——proxy-persist里挂的 2 例(scheduleSave debounces / flushSync writes)在不含本 PR 改动的 master 上同样失败(本地环境问题,与本 diff 无关),全量以 CI 为准。