Repository navigation
fix(server): capture complete turn checkpoints after edits finish - #220
Conversation
Mid-turn provider diffs were treated as the final checkpoint, nested Git workspaces were skipped, and huge patches truncated automatic summaries. Capture now waits for turn completion or an eligible abort, detects repositories through CheckpointStore, and builds summaries from NUL-delimited numstat. Git init during a turn no longer blocks later captures, and status refresh no longer runs ahead of the snapshot. Adapted from pingdotgg/t3code pingdotgg#9694 pingdotgg#9842 pingdotgg#9841 pingdotgg#10078 pingdotgg#10347.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR updates checkpoint handling to capture the final filesystem state for completed and eligible interrupted turns, supports nested Git workspaces and repositories initialized during a turn, and produces path-safe file summaries. It also separates Git-status refresh work from checkpoint capture, preserves interrupted state through projections, and removes an unused patch-parsing dependency. Confidence Score: 5/5Safe to merge. No outstanding findings remain. Files Needing Attention: None. Reviews (5): Last reviewed commit: "merge main into checkpoint safety" | Re-trigger Greptile |
Automatic numstat compared full parent-repository trees, so a sibling commit between nested-workspace captures showed up in the turn file list. Restrict numstat diffs to the session cwd. On-demand patches stay whole-tree.
|
This is Leo's agent. Current GitHub state is CONFLICTING/DIRTY for 5e89969. A read-only Preserve both sides: main's activity/message/proposed-plan repository imports and No branch or worktree files were modified. Orca delivery remains blocked by the missing selected executable, so this comment is a repair specification, not confirmed worker delivery or execution. |
Problem
Turn checkpoints could freeze too early, skip nested Git workspaces, and lose summaries on large diffs.
Provider runtimes can publish a diff update before they finish writing files. The reactor treated that placeholder as the final checkpoint, then skipped the real completion capture. Later edits landed on the next turn. Projects opened in a subdirectory of a Git repo were skipped because the reactor looked for
.gitonly in the project directory. Automatic summaries parsed full unified patches, so changes over the 10 MB output cap produced incomplete counts. Agit initduring a turn left no baseline and could stop later captures. Git status refresh ran on the same worker before capture, so a slow refresh could let a follow-up edit into the snapshot.Changes
Capture the workspace only when a turn completes or an eligible abort arrives. Reuse any placeholder turn count and assistant message id. Ignore aborts that never started and were not the active session. Detect repositories through
CheckpointStore.isGitRepositoryso nested workspaces checkpoint and revert. Build automatic summaries from NUL-delimited Git numstat; on-demand diffs stay as patches. Skip the summary when no pre-turn baseline exists, keep the completion checkpoint, and resume after git init. Run local git status refresh on its own drainable worker so capture does not wait behind it.SQL, in-memory, and client projections keep an interrupted turn interrupted when the real checkpoint becomes ready. A missing git ref is not treated as an interruption.
Akeru still uses
AgentControllerrather thanProviderService. Chat copy, imported-history filtering, and the absence of hosted pull-request refresh stay as they were. Group/channel/bot fields are unchanged.Upstream
Reviewed adaptations of pingdotgg/t3code:
Scope
This PR is checkpoint correctness only.
Still assigned, separate PRs:
Verification
vp test runof CheckpointReactor, CheckpointStore, Diffs, VcsProcess, ProviderRuntimeIngestion, ProjectionPipeline, projector, and client-runtime threadReducer: 218 tests passed. New cases wait on typed receipts and worker drains.vp run --filter akeru-bot --filter @t3tools/client-runtime typecheckpassed (existing Effect suggestions only).Limitations
Stop followed immediately by another message can still skip the interrupted snapshot if a newer active turn is already present. That ordering boundary is unchanged. Attachment cleanup and session reaper work are not in this PR.
Implemented and verified by Grok 4.6 High in Grok Build via Orca.