fix(models): handle repeated title headings - #272
Open
AoHanBei wants to merge 1 commit into
Open
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.
Fixes #271
Problem
In title parse mode, a repeated field heading is no longer recognized after its first occurrence. The repeated heading and its value are appended to the previous section, which can either raise a parsing error for typed fields or silently produce an incorrect value.
Root cause
_parse_title_contentremoved each recognized heading fromoutput_titles. Once removed, a later occurrence of the same heading could no longer start a new section.Changes
int,bool, andstrheadings.Validation
pytest tests/src/models -q -p no:cacheprovider— 37 passedpytest tests/src/agents/test_customize_agent_config.py tests/src/agents/test_customize_action.py -q -p no:cacheprovider— 54 passedruff check tests/src/models/test_base_model.py— passedgit diff --check— passedThe complete suite produced 233 passes and 22 Windows-only benchmark failures. Twenty failures come from the existing
os.path.exists(path=...)call, which is rejected by Windowsntpath; the other two are existing LiveCodeBench execution differences on Windows. None involve the modified parser or its adjacent modules.Compatibility
This does not change the public API or parsing format. Repeated headings now follow the parser's existing assignment behavior, where the latest recognized section replaces the earlier value.
AI assistance
AI assistance was used during investigation, implementation, and regression-test drafting. I reviewed the final diff and test results and take responsibility for the submitted change.