Fix: _strip_ansi regex covers only a subset of CSI escape sequences (#52) - #55
Merged
Conversation
) The test helper only stripped a narrow set of CSI final bytes, which made the suite fragile if Rich emitted other valid escape sequences. Changes: - Broadened `_strip_ansi` to strip the full CSI range - Added a regression test for cursor-movement CSI sequences Fixes #52
Owner
Author
🔍 Automated Code ReviewSummaryThe fix now matches the broader CSI form expected by the investigation and the regression test covers both cursor movement and private-mode sequences. Findings✅ Strengths
|
Owner
Author
PR 55 ReviewRecommendationApprove. SummaryThe PR is focused and matches the issue report. The regex expansion in FindingsLow
Validation
Notes
|
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.
Summary
The
_strip_ansihelper intests/test_workflow_to_harness.pyonly stripped a narrow set of CSI escape-sequence final bytes, making the test suite fragile if Rich emits other valid sequences.Root Cause
The helper hard-coded
[mGKHFJ]instead of matching the full CSI final-byte range the helper name and docstring imply.Changes
tests/test_workflow_to_harness.py_strip_ansito strip the full CSI rangetests/test_workflow_to_harness.pyTesting
make qaValidation
make qa && uv run --locked pytest tests/test_workflow_to_harness.py -k strip_ansiIssue
Fixes #52
📋 Implementation Details
Implementation followed artifact:
/repo/.agents/issues/issue-52.mdDeviations from plan:
None
Automated implementation from investigation artifact