Skip to content

Conversation

@TerminallyLazy
Copy link
Contributor

Add complete checkpoint mechanism for saving and restoring agent state:

Core Features:

  • Save/restore full agent context including history, config, and execution state
  • Multiple storage backends (file-based and in-memory)
  • Automatic checkpoints at configurable message intervals
  • Manual checkpoint creation via tool
  • Checkpoint validation with structure hash verification
  • Cleanup of old checkpoints (keeps last N)

Backend Components:

  • AgentCheckpoint model with Pydantic V2 validation
  • CheckpointStore interface with FileCheckpointStore and MemoryCheckpointStore
  • CheckpointManager singleton for centralized operations
  • Integration with TaskScheduler for checkpoint-based task resumption

API Endpoints:

  • POST /api_checkpoint_create - Create manual checkpoint
  • GET /api_checkpoint_list - List checkpoints (supports ?all=true for all contexts)
  • POST /api_checkpoint_restore - Restore from checkpoint
  • DELETE /api_checkpoint_delete - Delete checkpoint
  • POST /api_checkpoint_cleanup - Remove old checkpoints

UI Components:

  • Checkpoint modal with context grouping and view toggle
  • Support for viewing checkpoints from deleted chats
  • Per-context cleanup functionality
  • Quick access button in sidebar

Extensions:

  • Auto-checkpoint at message intervals (configurable)
  • Duplicate prevention via message count tracking

Files: 16 changed, 1839 insertions(+)

Add complete checkpoint mechanism for saving and restoring agent state:

Core Features:
- Save/restore full agent context including history, config, and execution state
- Multiple storage backends (file-based and in-memory)
- Automatic checkpoints at configurable message intervals
- Manual checkpoint creation via tool
- Checkpoint validation with structure hash verification
- Cleanup of old checkpoints (keeps last N)

Backend Components:
- AgentCheckpoint model with Pydantic V2 validation
- CheckpointStore interface with FileCheckpointStore and MemoryCheckpointStore
- CheckpointManager singleton for centralized operations
- Integration with TaskScheduler for checkpoint-based task resumption

API Endpoints:
- POST /api_checkpoint_create - Create manual checkpoint
- GET /api_checkpoint_list - List checkpoints (supports ?all=true for all contexts)
- POST /api_checkpoint_restore - Restore from checkpoint
- DELETE /api_checkpoint_delete - Delete checkpoint
- POST /api_checkpoint_cleanup - Remove old checkpoints

UI Components:
- Checkpoint modal with context grouping and view toggle
- Support for viewing checkpoints from deleted chats
- Per-context cleanup functionality
- Quick access button in sidebar

Extensions:
- Auto-checkpoint at message intervals (configurable)
- Duplicate prevention via message count tracking

Files: 16 changed, 1839 insertions(+)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant