Skip to content

fix(session): 区分运行时快照与重启恢复 - #11

Merged
h3c-hexin merged 2 commits into
pinvou3-cleanfrom
fix/session-snapshot-recovery
Aug 11, 2026
Merged

fix(session): 区分运行时快照与重启恢复#11
h3c-hexin merged 2 commits into
pinvou3-cleanfrom
fix/session-snapshot-recovery

Conversation

@h3c-hexin

@h3c-hexin h3c-hexin commented Aug 11, 2026

Copy link
Copy Markdown

No-Issue: pinvou-agent v0.9.5 桌面会话回归修复,无独立 CodeWhale Issue。

背景

v0.9.5 的 SessionManager::load_session 会在每次读取时修复无配对的 tool_use。嵌入宿主可能在工具仍执行时持久化并读取会话,这会把在途调用误判为进程崩溃,污染会话历史。

公开 fork 基线同时丢失了分支保护仍要求的 Pinvou fork CI,导致 Gitleakscheck 两个 required context 永远无法产生。

变更

  • 新增无修复副作用的 load_session_snapshot,供运行时读取使用
  • 新增显式 recover_session_for_resume,返回可观测的恢复统计并由宿主决定何时持久化
  • 保留 load_session 的既有恢复语义,避免改变 CodeWhale 独立恢复流程
  • 增加运行时快照与显式恢复幂等回归测试
  • 恢复 Pinvou fork 的 Gitleaks、workspace check 与 forkguard CI

验证

  • cargo fmt --all -- --check
  • cargo test -p codewhale-tui forkguard_ -- --nocapture:23 passed
  • GitHub required checks:DCO、贡献 gate、Gitleaks、workspace all-targets check 与 forkguard 全绿
  • CodeQL:通过

边界与风险

  • 不修改会话文件格式和现有 load_session 调用方行为
  • 新 API 面向嵌入宿主;只有宿主明确确认进程或 Engine 已重启时才调用恢复入口
  • 完整桌面接入与连续对话回归由关联的 Pinvou Agent PR 覆盖
  • CI 恢复的是此前已存在、且仍被分支保护要求的原始门禁配置

发布

  • squash merge:2eceab4e19cb0b15576c09d5b89e0d8bc42e11fd
  • 不可变标签:pinvou-v0.9.5-r5

关联

Signed-off-by: hexin <372726039@qq.com>
公开 fork 基线丢失了仍被分支保护要求的 Gitleaks 和 check workflow。恢复原有扫描、workspace check 与 forkguard 测试,使 PR 能由真实门禁验证。

Signed-off-by: hexin <372726039@qq.com>
@h3c-hexin h3c-hexin closed this Aug 11, 2026
@h3c-hexin h3c-hexin reopened this Aug 11, 2026
@h3c-hexin
h3c-hexin merged commit 2eceab4 into pinvou3-clean Aug 11, 2026
17 of 18 checks passed
@h3c-hexin
h3c-hexin deleted the fix/session-snapshot-recovery branch August 11, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant