Repository navigation
Open
Labels
enhancementNew feature or request
Description
一句话结论
OMP 的 checkpoint / rewind 解决的是“临时进入高噪声调查,最后只把结论带回来”;OpenPI 的 context_pivot 解决的是“长 Session 换阶段并主动压缩”。两者不是同一个生命周期。
建议研究一个 Pi-native、默认关闭、仅裁剪 Session context、不触碰文件系统 的探索边界。先验证收益和 Pi extension seam,再决定是否实现;不要直接复制 OMP 的强制工作流。
固定证据
对比固定在:
- OpenPI
main@2a69d3f32994da4123f1312b7fa84ef3d6119be1 - OMP
main@7623b960540518bb1291808bbae28332065e9dba
OMP 当前机制:
checkpoint在普通 Session entry 上记录边界,并可在 resume 后重建活动 checkpoint:checkpoint contractrewind在 turn end 从 checkpoint 分支,写入branch_summary/ retained report,随后重建模型上下文;被放弃的探索仍留在 JSONL,只是不再进入 active branch:rewind flow- 它明确不恢复文件、artifact、process 或 git state:rewind boundaries
OpenPI 当前机制:
context_pivot只有在 context 估算达到 30k token 时暴露,并通过 Pi 原生ctx.compact()替换为 next-phase brief:current gate and compaction, execution path- 这要求“长上下文 + 阶段切换”,不覆盖短但高噪声的探索事务。
- context_pivot can pass the 30k gate but fail with “Nothing to compact” #24 讨论的是
context_pivot预检与 Pi compaction eligibility 不一致,不是探索回收语义。
为什么值得讨论
典型场景:
- 主 Agent 已有稳定任务上下文;
- 需要追一条可能失败的根因、读大量日志或比较多个实现;
- 调查结束后,后续实现只需要结论、证据位置和被排除路径;
- 把全部探索轨迹继续带入模型,会抬高 token、污染注意力,也降低 prompt cache 稳定性。
这类能力随模型变强仍然有用:模型负责决定何时进入探索、写什么报告;runtime 只保证分支、保留和恢复事实。
OpenPI 应保留的优势
- 默认 zero-resident,不为普通回合增加 schema / prompt 税;
- Pi Session 仍是唯一 source of truth;
- 不引入第二套文件快照、git checkpoint 或外部状态机;
- 不把“调查—回滚—实现”固化成强制推理流程;
- fail closed:不能证明安全分支与恢复时,不得声称 rewind 成功。
建议先回答的问题
- Pi 当前 extension API 是否已经能安全创建 branch summary / 移动 active leaf?若不能,应先向 Pi 提最小 seam,而不是在 OpenPI 旁路改写 JSONL。
- checkpoint 在 compaction、session switch、fork、resume 后如何重建?
- rewind 前后的未完成 tool call、background job、Subagent/Workflow completion 如何处理?
- 是否只允许 idle boundary 执行,避免 turn 内历史与 UI 投影不一致?
- 失败时如何证明 active branch 没有被部分移动?
- 是否需要先做 benchmark:同一调查任务,有/无探索回收时的质量、cache、token 和恢复正确性。
非目标
- 不恢复或回滚 working tree;
- 不删除 Session 历史;
- 不实现多 checkpoint 栈;
- 不自动判断“这条思路失败了”;
- 不复制 OMP 的全局 runtime 或 provider stack。
完成条件
- 写出 Pi-native feasibility note,明确需要的现有 seam 或缺失 seam
- 定义 success / failure / cancellation / resume 的可观察证据
- 覆盖 compaction、fork/tree navigation、session resume 与 background completion 的交互矩阵
- 用至少一个高噪声调查任务比较质量、token、prompt cache 和最终上下文
- 若实现,默认关闭且 ordinary parent turn 不新增常驻工具
- 若无法保持 Pi 为 source of truth,记录拒绝方案而不是旁路实现
与现有 Issue 的关系
- 研究 OMP:模型能力 × Harness 脚手架强度的收益曲线 #45:OMP 总体 Harness 对标与机制消融的 umbrella
- context_pivot can pass the 30k gate but fail with “Nothing to compact” #24:现有
context_pivot的 compaction eligibility bug - 本 Issue:专门验证“可回收探索上下文”是否是值得进入 OpenPI 的正交机制
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
627150795 commentedon Aug 28, 2026
Hi! I would like to work on this research/documentation issue.
I will document the distinction between recyclable exploration checkpoints/rewind and
context_pivot, including lifecycle, recovery, branch, retention, and authority boundaries. I will keep this contribution documentation-only: no runtime checkpoint manager, API, or UI changes.627150795 commentedon Aug 28, 2026
Update: the exploration checkpoint/rewind contract is implemented in PR #250: #250
Validation completed:
git diff --cached --check,bun run lint, andbun run typecheckpassed. This is documentation-only; it does not add a checkpoint manager, restore files, mutate Git refs, or changecontext_pivotruntime behavior. The PR uses the repository template and will close this issue when merged.tt-a1i commentedon Sep 8, 2026
2026-09-08 目录补一条文件系统对照,不改 #154「只裁剪 context、不碰工作区」的现结论。
官方 example
git-checkpoint.ts(earendil-works/pimainblob6f26cff)在turn_start做git stash create,/fork时可stash apply回到那一 turn 的代码。这和 OMP/本帖的 Session context checkpoint 不是同一生命周期。问题开在 #508。本轮未运行该 example。不提议把 stash 恢复默认打开。
tt-a1i commentedon Sep 9, 2026
结论
官方
/handoff和@pify/yolorewind 都不是本帖要的「只裁剪 Session context、不碰文件系统」。本帖范围不用改。事实(源码,未安装未运行)
handoff.tsblobed3416be(earendil-works/pi6160683):序列化当前 branch(含 compaction 摘要)→ 另一次模型生成 → 用户编辑草稿 →newSession({ parentSession })→ 新会话setEditorText。TUI-only。不碰工作区。a9b40f0的context_pivot仍是同会话ctx.compact()。/plan fresh已经占用同一条newSession({ parentSession })缝,brief 来自 Plan Ready,不是一般/handoff。/handoffskill,也没有registerCommand("handoff")。SETUP.md 写「use the separate/handoffskill」是文档谎言(模型可见的context-pivotdescription / 错误同样指向它)。不是本帖的实现缺口。@pify/yolo0.9.1(4c019d0)的/yolo rewind按用户 prompt 恢复工作树(git checkout <stash> -- .)和/或调用navigateTree。这是文件系统 + 会话 leaf,违反本帖非目标第一条。建议
新会话 + parent 指针挂 #193。工作区 / turn 恢复挂 #508。不要为本帖引入 stash 或 yolo 产品。
本地深读:
docs/research/EXPERIMENT_HANDOFF_GATES_2026-09-09.md。本轮未pi install、未运行。tt-a1i commentedon Sep 9, 2026
2026-09-09 对照一条目录/切换缝,不改本帖「只裁剪 context、不碰工作区」的现结论。
/sessions与 Pi 原生/resume换的是哪一个 Session 文件是当前活动会话:session_before_switch→ shutdown → 打开目标 JSONL →session_start(reason: resume)。这不是 rewind,也不是 compaction。switchSession,禁止旁路改 JSONL 或第二套 session store。branch_summary。context_pivot/ 原生 compaction 是改模型窗口。新会话 handoff 是另一份 JSONL +parentSession(见同日 handoff 记录)。源码对照写在
docs/research/EXPERIMENT_SESSIONS_CONTINUITY_2026-09-09.md。本轮未安装、未运行社区包。不提议把 picker 扩成 rewind,也不把 #154 并进/sessions或 #474。tt-a1i commentedon Sep 9, 2026
结论
社区包
cyclotomy0.2.4 把工作区检查点绑到 Pi/tree节点上。这不是本帖要的「只裁剪 Session context、不碰文件系统」。本帖范围不用改。事实(源码,未安装未运行)
/tree仍是 Pi 内建:navigateTree→session_before_tree(可{ cancel: true })→ 改 leaf →session_tree。Cyclotomy 不注册/tree。~/.pi/agent/cyclotomy/)里按(sessionId, stable entryId)存最多一份工作区快照;不写 Pi JSONL,不改.git。/tree若目标与磁盘不同:stay / detach / restore。无 UI + drift:取消 leaf 移动。Print/JSON 重开会话时留盘;RPC 等/restore。那不是 print 模式下的/tree。enabled: true。卸载不删明文副本。OpenPI
a9b40f0没有session_before_treehandler。SESSIONS 记录「/tree不改工作区」在没装这个包、或包已停时仍成立。建议
不要为本帖引入工作区快照或这套 CAS。工作区轴挂 #508(fork stash ≠
/tree绑盘 ≠ 本帖)。不装。不开新 Ideas。本地深读:
docs/research/EXPERIMENT_CYCLOTOMY_TREE_2026-09-09.md。钉[email protected]/ gitaa54bab。未pi install、未运行。