mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-10 03:37:51 +02:00
feat(cli): add keep_latest prune strategy to ThreadTTLConfig (#6784)
## Summary - Add `"keep_latest"` to `ThreadTTLConfig.strategy` to match langgraph-api support for pruning old checkpoints while retaining the thread and its latest state - Add `sweep_limit` to `ThreadTTLConfig` where the API actually reads it (was previously a no-op on `CheckpointerConfig`) - Regenerate `schema.json` / `schema.v0.json` ## Test plan - [x] `make format && make lint` passes - [x] `make test` passes (85/85) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
f9870bc9ae
commit
f5e56e200d
@@ -196,6 +196,11 @@ def validate_config(config: Config) -> Config:
|
||||
f"Python version {pyversion} is not supported. "
|
||||
f"Minimum required version is {MIN_PYTHON_VERSION}."
|
||||
)
|
||||
if "bullseye" in pyversion:
|
||||
raise click.UsageError(
|
||||
"Bullseye images were deprecated in version 0.4.13. "
|
||||
"Please use 'bookworm' or 'debian' instead."
|
||||
)
|
||||
|
||||
if not config["dependencies"]:
|
||||
raise click.UsageError(
|
||||
|
||||
@@ -107,17 +107,19 @@ class StoreConfig(TypedDict, total=False):
|
||||
class ThreadTTLConfig(TypedDict, total=False):
|
||||
"""Configure a default TTL for checkpointed data within threads."""
|
||||
|
||||
strategy: Literal["delete"]
|
||||
"""Strategy to use for deleting checkpointed data.
|
||||
|
||||
Choices:
|
||||
- "delete": Delete all checkpoints for a thread after TTL expires.
|
||||
strategy: Literal["delete", "keep_latest"]
|
||||
"""Action taken when a thread exceeds its TTL.
|
||||
|
||||
- "delete": Remove the thread and all its data entirely.
|
||||
- "keep_latest": Prune old checkpoints but keep the thread and its latest state.
|
||||
"""
|
||||
default_ttl: float | None
|
||||
"""Default TTL (time-to-live) in minutes for checkpointed data."""
|
||||
sweep_interval_minutes: int | None
|
||||
"""Interval in minutes between sweep iterations.
|
||||
If omitted, a default interval will be used (typically ~ 5 minutes)."""
|
||||
sweep_limit: int | None
|
||||
"""Maximum number of threads to process per sweep iteration. Defaults to 1000."""
|
||||
|
||||
|
||||
class SerdeConfig(TypedDict, total=False):
|
||||
@@ -173,14 +175,12 @@ class CheckpointerConfig(TypedDict, total=False):
|
||||
"""
|
||||
serde: SerdeConfig | None
|
||||
"""Optional. Defines the serde configuration.
|
||||
|
||||
|
||||
If provided, the checkpointer will apply serde settings according to the configuration.
|
||||
If omitted, no serde behavior is configured.
|
||||
|
||||
This configuration requires server version 0.5 or later to take effect.
|
||||
"""
|
||||
sweep_limit: int | None
|
||||
"""Maximum number of threads to process per sweep iteration. Defaults to 1000."""
|
||||
|
||||
|
||||
class SecurityConfig(TypedDict, total=False):
|
||||
|
||||
Reference in New Issue
Block a user