Repository navigation
fix(server): load session history without starting a Pi process - #424
Conversation
commit: |
Required CI blocker — not reviewed or mergedHead Stopped at CI, before full code review/independent E2E. Reconcile those interface/implementation error channels without masking them with assertions, obtain successful required checks, then restart review and real cold-history acceptance. No rerun, implementation changes, conflict resolution or merge performed. |
CI type-error repair submitted — not independent acceptanceRepair commit The private read dispatcher now preserves the union of its live-runtime and cold-file error channels. The injected cold model reader handles only Added a runnable regression covering absent cold data, unreadable cold data and closed live-runtime reads. Before the repair it failed with This removes the locally reproduced compilation blocker only. New required CI, full independent correctness/security review and cold-history/no-child-process/resume runtime acceptance remain required. No approval, merge or deferred auto-merge. |
Queue update after verified #423 merge — waiting at CIHead Required CI for this new head is queued/in progress at this observation, so no old-head review or acceptance is carried forward. The earlier repair/self-test record is not independent acceptance. No additional repair was made. No merge or deferred auto-merge. Continue only after the applicable blocker is resolved and the new version passes required CI → review → independent acceptance. |
|
auto-merge: no head: Fail closed on exclusions + no matching allowed group:
Din review-first; no merge. |
Opening a session read transcript and model state by acquiring a pie-pi-process. The session now sends those reads to the live process when one is held, and otherwise opens the Pi session file once with SessionManager and reuses that handle.
d44bfb8 to
2014707
Compare
Review — blocked on a persistence decision (not merged)
Blocking: daemon now opens Pi's transcript files in-process
Before this change only the Needed to unblock:
Non-blocking notes
Restart at CI after the PR changes. |
Cold history reads may open a Pi transcript in the daemon. Pi 0.99.1 can append a missing newline, rewrite the file on migration, or write a header into an empty file. Record owner, trigger, atomicity, and concurrency.
|
auto-merge: no Head
This needs Din's review. |
审查与独立验证记录:通过
之前的阻塞
审查
独立验证 在 reviewer 自己的 worktree 中检出该 head,执行
这是 server 和 CLI 路径的证明,属于非 UI 改动,按 acceptance 规则用命令结果作证据。Session 的 transcript 写在操作者共享的 未覆盖 没有构造 version < 3 的旧 transcript、末尾缺换行的文件或空文件,现场验证修复写入。这三种情况由 Pi 实现决定,清单里已登记,本 PR 的测试覆盖了路由和句柄生命周期。 结论:通过,可以合并。若 head 或 base 变化,从 CI 重新开始。 |
|
已合并(squash)。merge commit 为 |
Summary
Opening a session was slow because
getMessagesandgetModelStateacquired apie-pi-process(about 6–12s) just to read settled history.Requests now go through the Pie session. If a Pi process is held or still starting, those reads use it. Otherwise the session opens the Pi file once with
SessionManager.findById+SessionManager.openand reuses that handle. Starting a process drops the handle so the daemon and the child do not both keep the file open.Isolated
pie servecheck against a seeded session file:getMessages46ms,getModelState4ms, secondgetMessages2ms, and no newpie-pi-process.Test plan
pnpm --filter @getpie/server exec vitest run test/harness/session.test.ts test/harness/session-service.test.ts test/harness/pi-agent.test.ts test/harness/pi/session-tools-composition.test.tsgetMessages/getModelStatereturn the on-disk transcript and Pi model, with no new Pi process