fix(hermes): read live WSL databases inside their distribution (#8254)

Windows SQLite cannot reliably read a live Hermes WAL database through a WSL UNC path. For wsl.localhost / wsl$ Hermes paths only, read the database inside the owning distribution via wsl.exe and Python SQLite (mode=ro, query_only, one short read transaction), streaming the result back in bounded JSON frames into the existing session projection. Non-WSL paths and macOS/Linux are unchanged. Requires python3 (3.7+) and timeout inside the distribution. Fixes #8205.
This commit is contained in:
Dante authored and GitHub committed 2026-10-17 21:37:51 +08:00
1 parent d18564481d
commit d23cee4c11
6 files changed
+655 -1

No files matched your search

+13
View File
@@ -208,6 +208,7 @@ jobs:
with:
distribution: Ubuntu-24.04
wsl-version: 2
additional-packages: python3
# 只恢复不保存:这里只编 lib 测试,若由它先存,同 key 的 Windows 缓存就只剩一小半。
# 完整缓存由 backend 矩阵的 Windows job 保存(同一个 shared-key)。
@@ -285,3 +286,15 @@ jobs:
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
- name: Run Hermes live WAL reads inside WSL2
env:
CC_SWITCH_WSL_DISTRO: Ubuntu-24.04
shell: pwsh
run: |
$testName = "session_manager::providers::hermes::tests::wsl2_live_wal_readonly_reference"
$testList = & $env:CC_SWITCH_TEST_EXE --list --ignored
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ($testList -notcontains "${testName}: test") { throw "Hermes WSL test not discovered" }
& $env:CC_SWITCH_TEST_EXE $testName --ignored --exact --nocapture
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }