Repository navigation
Fix step budgets for follow-up turns in checkpointed conversations - #1201
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A long checkpointed conversation could exhaust the step budget before a new operator request used any tools. Count messages from the latest actual HumanMessage so each operator turn receives its configured budget. Tool results and interrupt/resume continuations retain the current turn; message content cannot reset it.
Verification: 12 focused cases pass, including real offline LangChain/LangGraph execution with InMemorySaver across two completed turns and repeated interrupts. The wider middleware/agent suites pass 1,111 cases; one optional Transformers test is explicitly skipped. Scoped Ruff lint/format and introduced-commit Gitleaks pass. Frozen runtime: LangChain1.4.7/core1.7.0, LangGraph1.2.17, DeepAgents0.7.32. No external provider/model calls, package publication or version bump; no hosted-CI pass is claimed.
Commands:
uv run --frozen pytest packages/decepticon/tests/unit/middleware packages/decepticon/tests/unit/agents -q;uv run --frozen ruff checkon the three changed Python files.CHAGELOG.md