Repository navigation
fix(session): batch long-term extraction of a large commit without an auto-commit policy - #6086
Open
OnePerson2020 wants to merge 1 commit into
Open
OnePerson2020 wants to merge 1 commit into
OnePerson2020 wants to merge 1 commit into
Conversation
… auto-commit policy Fixes volcengine#6085
This branch has not been deployed
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.
Description
Long-term extraction is batched only when the session has an auto-commit policy, so a commit without one (explicit
commit(), imports/backfills) sends the whole archive to the model in one call however large it is. Auto-commit never lets an archive exceedpending_token_threshold(default 150k), so this is the one unbounded path. A policy-less archive larger thanDEFAULT_PENDING_TOKEN_THRESHOLDis now split with that threshold, exactly as an auto-committed archive would be; smaller ones keep the single-call path.Human Involvement
Related Issue
Fixes #6085
Type of Change
Changes Made
extraction_batch.py:long_term_extraction_batch_limits(limits, messages)returns the policy limits, orExtractionBatchLimits(max_message_tokens=DEFAULT_PENDING_TOKEN_THRESHOLD)for a policy-less archive above that threshold.session.py: the long-term step uses it (one call site).test_long_term_extraction_without_policy_batches_only_a_large_commit.Testing
test_session_commit_race.pyhangs on main locally, so it is excluded). Ruff andgit diff --checkclean.Checklist
Additional Notes
No API or data-format change; no new dependency.
🤖 Generated with Claude Code