feat(027-checkpoint-resume-contrib): add --checkpoint CLI flag (default: disabled)
This commit is contained in:
parent
effbf3c6aa
commit
e74a715e0a
|
|
@ -926,7 +926,7 @@ def format_tool_args(args, max_length=80) -> str:
|
||||||
return result[:max_length - 3] + "..."
|
return result[:max_length - 3] + "..."
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def run_analysis():
|
def run_analysis(checkpoint: bool = False):
|
||||||
# First get all user selections
|
# First get all user selections
|
||||||
selections = get_user_selections()
|
selections = get_user_selections()
|
||||||
|
|
||||||
|
|
@ -943,6 +943,7 @@ def run_analysis():
|
||||||
config["openai_reasoning_effort"] = selections.get("openai_reasoning_effort")
|
config["openai_reasoning_effort"] = selections.get("openai_reasoning_effort")
|
||||||
config["anthropic_effort"] = selections.get("anthropic_effort")
|
config["anthropic_effort"] = selections.get("anthropic_effort")
|
||||||
config["output_language"] = selections.get("output_language", "English")
|
config["output_language"] = selections.get("output_language", "English")
|
||||||
|
config["checkpoint_enabled"] = checkpoint
|
||||||
|
|
||||||
# Create stats callback handler for tracking LLM/tool calls
|
# Create stats callback handler for tracking LLM/tool calls
|
||||||
stats_handler = StatsCallbackHandler()
|
stats_handler = StatsCallbackHandler()
|
||||||
|
|
@ -1197,8 +1198,10 @@ def run_analysis():
|
||||||
|
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def analyze():
|
def analyze(
|
||||||
run_analysis()
|
checkpoint: bool = typer.Option(False, "--checkpoint", help="Enable checkpoint/resume: save state after each node so crashed runs can resume."),
|
||||||
|
):
|
||||||
|
run_analysis(checkpoint=checkpoint)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ DEFAULT_CONFIG = {
|
||||||
"google_thinking_level": None, # "high", "minimal", etc.
|
"google_thinking_level": None, # "high", "minimal", etc.
|
||||||
"openai_reasoning_effort": None, # "medium", "high", "low"
|
"openai_reasoning_effort": None, # "medium", "high", "low"
|
||||||
"anthropic_effort": None, # "high", "medium", "low"
|
"anthropic_effort": None, # "high", "medium", "low"
|
||||||
|
# Checkpoint/resume: when True, LangGraph saves state after each node
|
||||||
|
# so a crashed run can resume from the last successful step.
|
||||||
|
"checkpoint_enabled": False,
|
||||||
# Output language for analyst reports and final decision
|
# Output language for analyst reports and final decision
|
||||||
# Internal agent debate stays in English for reasoning quality
|
# Internal agent debate stays in English for reasoning quality
|
||||||
"output_language": "English",
|
"output_language": "English",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue