feat(checkpoint): implement four automatic checkpoint triggers per spec §19449 #10254

Open
opened 2026-04-17 11:45:40 +00:00 by hamza.khyari · 1 comment
Member

Summary

The specification (§19449-19467) defines four automatic checkpoint triggers that should fire during plan execution. PR #4218 wired CheckpointManager into PlanExecutor, but the four trigger points and their configuration are not yet implemented.

Metadata

  • Commit Message: feat(checkpoint): implement four automatic checkpoint triggers per spec §19449
  • Branch: feature/checkpoint-auto-triggers

Spec Reference (§19449-19467)

Trigger When Component
on_tool_write Before each write-tool execution ToolRunner
on_tool_write_complete After each write-tool execution ToolRunner
on_subplan_spawn Before first subplan execution attempt SubplanExecutionService
on_error When the Execute phase fails PlanExecutor

Configuration via core.checkpoints.auto_create_on (default: all four enabled). When the list is empty, all automatic checkpointing is skipped.

CheckpointService is injected as an optional parameter into ToolRunner, SubplanExecutionService, and PlanExecutor. When None, all automatic checkpointing is skipped (backward-compatible no-op).

Current Behavior

CheckpointManager is wired into PlanExecutor (PR #4218 / #1253), but:

  • ToolRunner does not create checkpoints before/after write-tool execution
  • SubplanExecutionService does not create checkpoints before subplan spawn
  • PlanExecutor does not create checkpoints on execute-phase error
  • No core.checkpoints.auto_create_on configuration exists

Subtasks

  • Inject CheckpointService into ToolRunner (optional param, no-op when None)
  • Implement on_tool_write trigger — create checkpoint before each write-tool execution
  • Implement on_tool_write_complete trigger — create checkpoint after each write-tool execution
  • Inject CheckpointService into SubplanExecutionService (optional param)
  • Implement on_subplan_spawn trigger — create checkpoint before first subplan attempt
  • Implement on_error trigger in PlanExecutor — create checkpoint when Execute phase fails
  • Add core.checkpoints.auto_create_on configuration (list of enabled triggers, default all four)
  • Read config and gate each trigger on whether it appears in the enabled list
  • Add Behave scenarios for each trigger (fires when enabled, skips when disabled, skips when service is None)
  • Add Robot integration test verifying checkpoint creation during a real plan execute

Definition of Done

  • All four triggers fire at the correct points during plan execution
  • Each trigger is independently configurable via core.checkpoints.auto_create_on
  • Empty list disables all automatic checkpointing
  • CheckpointService=None is a backward-compatible no-op for all triggers
  • Behave + Robot tests cover all trigger points and configuration combinations

Depends On

  • #1253 (CheckpointManager wired into PlanExecutor) — PR #4218
## Summary The specification (§19449-19467) defines four automatic checkpoint triggers that should fire during plan execution. PR #4218 wired `CheckpointManager` into `PlanExecutor`, but the four trigger points and their configuration are not yet implemented. ## Metadata - **Commit Message**: `feat(checkpoint): implement four automatic checkpoint triggers per spec §19449` - **Branch**: `feature/checkpoint-auto-triggers` ## Spec Reference (§19449-19467) | Trigger | When | Component | |---------|------|-----------| | `on_tool_write` | Before each write-tool execution | `ToolRunner` | | `on_tool_write_complete` | After each write-tool execution | `ToolRunner` | | `on_subplan_spawn` | Before first subplan execution attempt | `SubplanExecutionService` | | `on_error` | When the Execute phase fails | `PlanExecutor` | Configuration via `core.checkpoints.auto_create_on` (default: all four enabled). When the list is empty, all automatic checkpointing is skipped. `CheckpointService` is injected as an optional parameter into `ToolRunner`, `SubplanExecutionService`, and `PlanExecutor`. When `None`, all automatic checkpointing is skipped (backward-compatible no-op). ## Current Behavior `CheckpointManager` is wired into `PlanExecutor` (PR #4218 / #1253), but: - `ToolRunner` does not create checkpoints before/after write-tool execution - `SubplanExecutionService` does not create checkpoints before subplan spawn - `PlanExecutor` does not create checkpoints on execute-phase error - No `core.checkpoints.auto_create_on` configuration exists ## Subtasks - [ ] Inject `CheckpointService` into `ToolRunner` (optional param, no-op when None) - [ ] Implement `on_tool_write` trigger — create checkpoint before each write-tool execution - [ ] Implement `on_tool_write_complete` trigger — create checkpoint after each write-tool execution - [ ] Inject `CheckpointService` into `SubplanExecutionService` (optional param) - [ ] Implement `on_subplan_spawn` trigger — create checkpoint before first subplan attempt - [ ] Implement `on_error` trigger in `PlanExecutor` — create checkpoint when Execute phase fails - [ ] Add `core.checkpoints.auto_create_on` configuration (list of enabled triggers, default all four) - [ ] Read config and gate each trigger on whether it appears in the enabled list - [ ] Add Behave scenarios for each trigger (fires when enabled, skips when disabled, skips when service is None) - [ ] Add Robot integration test verifying checkpoint creation during a real plan execute ## Definition of Done - All four triggers fire at the correct points during plan execution - Each trigger is independently configurable via `core.checkpoints.auto_create_on` - Empty list disables all automatic checkpointing - `CheckpointService=None` is a backward-compatible no-op for all triggers - Behave + Robot tests cover all trigger points and configuration combinations ## Depends On - #1253 (CheckpointManager wired into PlanExecutor) — PR #4218
hamza.khyari added this to the v3.5.0 milestone 2026-04-17 11:45:40 +00:00
Owner

@hamza.khyari — Thank you for filing this feature issue.\n\nIssue #10254 has been received and logged. The four automatic checkpoint triggers you've specified (on_tool_write, on_tool_write_complete, on_subplan_spawn, on_error) are well-documented with clear spec references (§19449-19467), subtasks, and a Definition of Done.\n\nTriage assessment:\n- Type: Feature (spec implementation)\n- Scope: CheckpointService injection into ToolRunner, SubplanExecutionService, and PlanExecutor; core.checkpoints.auto_create_on configuration\n- Priority: High (spec compliance for checkpoint system)\n- Milestone: v3.5.0 (correctly assigned)\n\nThe issue is labeled "Needs Feedback" — if there are open questions requiring project owner input, please clarify them in a comment. If the issue is fully specified and ready for implementation, the label can be removed.\n\nThe implementation team will review and schedule this work.\n\n---\nAutomated by CleverAgents Bot\nAgent: automation-tracking-manager"}},{

@hamza.khyari — Thank you for filing this feature issue.\n\nIssue #10254 has been received and logged. The four automatic checkpoint triggers you've specified (on_tool_write, on_tool_write_complete, on_subplan_spawn, on_error) are well-documented with clear spec references (§19449-19467), subtasks, and a Definition of Done.\n\n**Triage assessment:**\n- **Type**: Feature (spec implementation)\n- **Scope**: CheckpointService injection into ToolRunner, SubplanExecutionService, and PlanExecutor; core.checkpoints.auto_create_on configuration\n- **Priority**: High (spec compliance for checkpoint system)\n- **Milestone**: v3.5.0 (correctly assigned)\n\nThe issue is labeled "Needs Feedback" — if there are open questions requiring project owner input, please clarify them in a comment. If the issue is fully specified and ready for implementation, the label can be removed.\n\nThe implementation team will review and schedule this work.\n\n---\n**Automated by CleverAgents Bot**\nAgent: automation-tracking-manager"}},{
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#10254
No description provided.