Skip to content

CLI --checkpoint flag does not actually enable checkpoint resume #1249

Description

@Jaswanth-Sriram-Veturi

The CLI exposes --checkpoint and TRADINGAGENTS_CHECKPOINT_ENABLED, but the interactive CLI execution path does not actually
configure or use the LangGraph checkpointer.

TradingAgentsGraph.propagate() configures the SQLite checkpointer, but cli/main.py::run_analysis() bypasses propagate() and
directly calls:

graph.graph.stream(init_agent_state, **args)

The graph is therefore compiled without a checkpointer and without a stable thread_id.

Reproduction

  1. Run the CLI with checkpointing enabled:
    --checkpoint
    or set:
    TRADINGAGENTS_CHECKPOINT_ENABLED=true
  2. Start an analysis for a ticker and date.
  3. Interrupt or crash the run after at least one graph node completes.
  4. Run the same analysis again with the same ticker, date, analyst selection, and research depth.

Actual behavior

  • No resumable checkpoint is created by the CLI path.
  • The second run starts from the beginning.
  • The CLI does not report that it is resuming from a checkpoint.
  • The checkpoint flag is accepted, but has no effect on the actual CLI graph execution.

Expected behavior

When checkpointing is enabled:

  • The CLI should compile the graph with the SQLite checkpointer.
  • It should provide a deterministic thread_id for the ticker, date, and graph shape.
  • A fresh run should receive the initial state.
  • A resumed run should pass None as the graph input so LangGraph resumes from the latest checkpoint.
  • Checkpoints should be cleared after successful completion.

Root cause

The checkpoint configuration exists, and the programmatic propagate() path sets up the checkpointer. However, the CLI has a
separate streaming path for its Live UI and does not call the checkpoint setup logic before calling graph.stream().

Regression test

A CLI regression test should:

  1. Use a two-node graph.
  2. Crash in the second node on the first run.
  3. Assert that the first node ran once and a checkpoint exists.
  4. Run again with the crash disabled.
  5. Assert that the first node still ran only once, proving the second run resumed rather than replayed it.
  6. Assert that the checkpoint is cleared after successful completion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions