TT

Time-Travel

Debugging & Replay LangGraph-inspired

Replay agent execution from any checkpoint, modify state, and re-run from that point to explore alternative paths and debug issues.

Overview

The Time-Travel Agent implements execution replay capabilities inspired by LangGraph's time-travel debugging. It enables:

Timeline Visualization

PAST ◀════════════════════════════════════════════▶ PRESENT

┌─────┐   ┌─────┐   ┌─────┐   ┌─────┐   ┌─────┐
│ CP1 │──▶│ CP2 │──▶│ CP3 │──▶│ CP4 │──▶│ CP5 │
└─────┘   └─────┘   └──┬──┘   └─────┘   └─────┘
                       │
                       │ [MODIFY STATE]
                       ▼
                    ┌─────┐   ┌─────┐   ┌─────┐
                    │CP3' │──▶│CP4' │──▶│CP5' │
                    └─────┘   └─────┘   └─────┘
                    (Branch)  (New)     (New)

Commands

/timetravel list

/timetravel list

Execution Timeline: wf_conductor_auth
Total Checkpoints: 12 | Duration: 45 min

Step | Checkpoint | Agent     | Action           | Time
-----|------------|-----------|------------------|-------
1    | cp_001     | architect | design_start     | 20:00
2    | cp_002     | architect | design_complete  | 20:15
3    | cp_003     | auto-code | impl_start       | 20:16
4    | cp_004     | auto-code | impl_50%         | 20:25
5    | cp_005     | auto-code | impl_complete    | 20:35  ← ERROR
...

/timetravel goto

/timetravel goto cp_004

Jumped to cp_004
Agent: auto-code
Action: Implementation 50% complete
Timestamp: 20:25 (20 min ago)

State at this point:
- Files created: 2 (/src/auth/jwt.ts, /src/auth/types.ts)
- Tests: 0
- Decisions: JWT, bcrypt, refresh tokens

Available: replay | modify | inspect | compare

/timetravel modify

/timetravel modify cp_004
> Change decision from JWT to Sessions

Branch Created: br_002
Original: decisions.auth_method = "JWT"
Modified: decisions.auth_method = "Sessions"

Replaying from cp_004 with Sessions auth...
[New execution with modified state]

/timetravel compare

/timetravel compare cp_012 br_002_cp_012

Comparison: Original vs Sessions Branch

Aspect       | Original (JWT) | Branch (Sessions)
-------------|----------------|------------------
Status       | ✓ Complete     | ✓ Complete
Duration     | 45 min         | 52 min
Files        | 8              | 10
Tests        | 6 pass         | 8 pass
Coverage     | 85%            | 92%

Use Cases

Integration Points

SystemIntegration
CheckpointUses checkpoints as replay starting points
EpisodeRecords full execution context for replay
MemoryStores timeline and branch data
TracingVisualizes execution paths