Repository navigation
fix(planning): bound output chunk assembly and progress diagnostics - #456
Open
Ehsan-hash wants to merge 1 commit into
Open
Ehsan-hash wants to merge 1 commit into
Ehsan-hash wants to merge 1 commit into
Conversation
Contributor
Author
|
The |
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.
Planning output recovery currently trusts
_forest_chunk.totaland builds a list of every missing index. A tiny malformed response can therefore trigger a very large allocation before recovery continues.Limit each output assembly to 2 through 64 complete JSON chunks, rejecting oversized totals before recording them. Progress replies retain at most 16 missing indices and include the exact missing count and a truncation flag. The recovery prompts and runtime documentation describe these bounds; task history and context-read steps remain unrestricted.
Validation: reproduced the original unsafe enumeration with an offline provider fixture and intercepted it before allocating a huge list. Oversized-count tests reach that guard against the original implementation. All 34 affected offline planning tests pass, including native and JSON-only tool formats, complete out-of-order 64-chunk merges, preserved assembly state and bounded progress replies. Two unrelated localhost HTTP transport tests were excluded under the network-disabled test profile. No live provider or model request was made.
Fixes #394