Skip to content

Releases: bbl21/opencode-session-recovery

v0.2.2 — Code Quality Improvements / 代码质量改进

Choose a tag to compare

@bbl21 bbl21 released this 16 May 04:24

English

  • Type annotations & dataclasses: Added full type hints to all functions in recover_sessions.py. Introduced StaleSession, MatchResult, and SessionInfo dataclasses to replace error-prone tuple unpacking.
  • Bug fix: Fixed undefined variable reference in format_timestamp (tsts_ms).
  • Windows UTF-8 support: Added console output encoding fix for Windows (GBK) environments.
  • Terminology correction: Corrected all references from git HEAD hash to git root commit hash throughout the codebase and documentation.
  • Bilingual README: Rewrote README with Chinese as the default language, followed by a complete English section.
  • Documentation updates: Added project_id stability table, two-phase matching explanation, database schema reference, and troubleshooting FAQ to README and SKILL.md.
  • Added docs/ to .gitignore.

中文

  • 类型注解与 dataclass:为 recover_sessions.py 所有函数添加完整类型注解,引入 StaleSessionMatchResultSessionInfo 三个 dataclass 替代易错的 tuple 解包。
  • Bug 修复:修正 format_timestamp 中未定义变量引用(tsts_ms)。
  • Windows UTF-8 支持:修复 Windows(GBK 编码)环境下控制台输出乱码问题。
  • 术语纠正:全文将 git HEAD hash 更正为 git root commit hash(git 根提交哈希)。
  • 双语 README:重写 README,中文为默认语言,下方附完整英文版。
  • 文档更新:README 和 SKILL.md 新增 project_id 稳定性表格、两阶段匹配说明、数据库结构参考和故障排查 FAQ。
  • docs/ 加入 .gitignore

v0.2.1 — README documentation update

Choose a tag to compare

@bbl21 bbl21 released this 15 May 07:51

v0.2.1 — README documentation update

Updated

  • README now includes --migrate and --count in Quick Start guide
  • Arguments table updated with all new flags
  • Added cross-project migration explanation section
  • Safety section updated for --migrate (also updates project_id)
  • Subagent session distinction documented
  • Skill directory synced to match workspace

v0.1.0 — Initial release

Choose a tag to compare

@bbl21 bbl21 released this 15 May 07:13

opencode-session-recovery v0.1.0

Recover lost opencode conversations after renaming or moving a project folder.

Usage

python scripts/recover_sessions.py --check      # 检查失效 session
python scripts/recover_sessions.py --relink --dry-run  # 预览
python scripts/recover_sessions.py --relink      # 自动恢复
python scripts/recover_sessions.py --old OLD --new NEW  # 手动指定

Features

  • Phase 1 — project_id match: 利用 git HEAD hash 自动恢复(安全可靠)
  • Phase 2 — path heuristic: 回退到同名父目录匹配(需人工确认)
  • 修改前自动备份数据库
  • 跨平台:Windows / macOS / Linux
  • 零外部依赖(仅 Python 标准库)