fix: add session-log migration tool for pre-0.1.0 logs (Fixes #19) - #21
Open
uluckystar wants to merge 1 commit into
Open
fix: add session-log migration tool for pre-0.1.0 logs (Fixes #19)#21uluckystar wants to merge 1 commit into
uluckystar wants to merge 1 commit into
Conversation
…er#19) Logs written by 0.1.0 and earlier carry agent-teams/* events without the ignorable envelope marker, so the harness refuses to load those sessions (SessionFormatUnsupportedError). Add a zero-dependency migration script that rewrites such logs in place (idempotent, --self-test included), and document it in the README.
Contributor
实测反馈:与你的工具等价的手工修复已在生产环境跑通(2026-08-21)刚在真实部署上执行了与本工具完全等价的修复(逐帧解码 → 给缺失标记的
两点建议:
支持合并 —— 这是 #19 的直接解决方案。 |
NanmiCoder
requested changes
Sep 5, 2026
NanmiCoder
left a comment
Owner
There was a problem hiding this comment.
感谢提供历史日志修复工具。自测通过,但我们复现了三种漏修:data 中出现 ignorable 字段、type 不是 JSON 首个键、顶层 ignorable 为 false。请按解析后的事件 envelope 判断,增加默认 dry-run、显式写入和自动备份,并用真实旧日志格式及目标宿主 reader 验证;暂不合入 README 的全目录原地修改命令。这个工具仍有价值,修正后继续审查。
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.
Fixes #19 — 存量会话日志迁移工具。
背景
0.1.0 及更早版本(以及 #8 修复前的本地构建)写入会话日志的
agent-teams/*事件没有携带ignorable信封标记。harness 的持久化协调器会拒绝解释任何包含"未知且未标记 ignorable"事件类型的日志:#8/#9 修复了新写入,但存量会话的日志仍然打不开,#19 请求提供迁移工具。
改动
scripts/migrate-session-logs.mjs(新增,零依赖,仅 Node 内置 zstd):agent-teams/*事件插入"ignorable": true,其余字节原样保留--self-test:内存构造合成日志验证插入与幂等性README.md:新增「存量日志迁移」章节,给出find ... -exec一键迁移命令与自检方式验证
node scripts/migrate-session-logs.mjs --self-test通过