fix: checkpoint settled tool batches before dispatch - #60
Conversation
Generated with Amplifier Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Independent Fable review — MERGE-READYNo correctness or failure-policy blockers found. This is a review-summary record, not a formal approval. Reviewed Loop PR #60 at The review supports one settled, ordered, post-append checkpoint before normal continuation and budget finalization; an always-writing CLI handler; failure stopping redispatch; cancellation propagation; and compatibility for hosts without the optional capability. Nonblocking findings — not changes in this PR:
No runtime changes are requested as merge prerequisites; keep the verified code unchanged. Verification: exact HEAD blobs match the tested R5 candidate; Loop 389 passed; paired CLI 2,362 passed / 3 skipped / 1 expected failure; CLI integration 13 passed; focused lint/format passed. Six synthetic overflow and three healthy real CLI/Core/Loop/Context/SessionStore cases preserved exact IDs, order, and values on disk and fresh resume; three typed PTY checks found disk identical before and after exit. Published Loop CI passed Python 3.11–3.14 and CLA. This is not proof against remote API/token-window/protected-floor behavior or normal unwrapped-bundle configuration; combined runtime used Linux/Python 3.12/Core 1.6.1 while CI uses Core 1.5.2. Interactive disk-write-failure recovery was not exercised end-to-end (unit failure-policy coverage only). Release boundary: upstream Loop half only; CLI remains local pending Loop merge and green main CI. No merge, deployment, or authority change is performed by this comment. |
What changed
session.durable_checkpointcoordinator capability.False, or ordinary exception stops further provider dispatch with an explicit error; cancellation propagates.Why
A later provider request can fail after tool work completed. Hosts that opt in can now durably persist the completed, canonical batch at the boundary where it is safe to resume.
Compatibility and scope
Verification
pytest tests -q— 389 passed.Breaking changes
None for existing hosts. Hosts that register
session.durable_checkpointnow receive an explicit failure instead of a further provider dispatch when their checkpoint cannot complete, by design.