Fix option setting removal to avoid multiple timing info warning #373
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.
Problem
When splitting definitions with options tracking enabled, the tool was emitting warnings about finding multiple timing info entries in the same prompt from coqtop:
This occurred because
Print Options.statements were being injected beforeSet/Unsetcommands, causing both statements to be grouped together in coqtop's response, resulting in multiple timing entries in a single prompt.Solution
Modified
split_statements_to_definitions_with_optionsto skip injectingPrint Options.beforeSet/Unsetstatements, since these are option-setting commands themselves. The fix:Set/Unsetstatements (including variants withLocal,Global,Polymorphic,Monomorphic, and attributes)Print Options.before statements that are NOTSet/Unsetcommands (and notProof (...)statements, which were already handled)Print Options.injection after each statement to properly track option changesThe regex pattern used is consistent with the
SET_REGpattern already used infind_bug.py.Example
Before:
→
Print Options.andSet Warningsmight be grouped together, causing multiple timing entriesAfter:
→
Set Warningshas its own timing entry,Print Options.has its own, no grouping issueThis eliminates the spurious warning while maintaining correct option tracking functionality.
Fixes the issue described in the title "Fix option setting removal".
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.