fix: handle truncated model responses explicitly - #36
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.
Model replies ending with
max_tokenswere recorded as completed. Reportresponse_truncated, print a stderr diagnostic, skip tools from the truncated reply, and preserve partial output, usage, and cost accounting. Keep subsequent interactive requests valid by retaining text and a truncation notice without replaying unexecuted tools or unfinished thinking. Headless exit status remains 0; the verifier determines task success.New Event Journals use schema v2, with v1 replay and projection still supported; public trajectories remain ATIF-v1.7. Update the changelog and bilingual protocol/CLI documentation, regenerate the complete English development notes from the Chinese source, and record the two-case benchmark rerun. Increased generation budgets and automatic continuation are documented as pending requirements; this implementation still stops at the unchanged response limit.
Validation:
regex-logandwrite-compressor: 0/2 passed at 8192 tokens per response, with no Harbor exceptions. Both runs correctly reportresponse_truncated, and both trajectories pass the official Harbor ATIF validator. The required output files were not created before truncation.