Repository navigation
fix(streaming): preserve Unicode across reply envelope boundaries - #574
Draft
dovvnloading wants to merge 3 commits into
Draft
dovvnloading wants to merge 3 commits into
dovvnloading wants to merge 3 commits into
Conversation
Use case-insensitive matches on original text to preserve character offsets. Cover chunk boundaries, Unicode tag variants, and parser/stream parity. Refs #573
Merge main and preserve its JSON-aware closer scanner. Match literal tags on original text with re.IGNORECASE, including malformed JSON fallback. Extend stream and parser regression coverage for Unicode offsets, quoted closers, malformed payloads and escaped quotes. No changes to CI, execution permissions or sandbox timeout assertions. Refs #573
This branch has not been deployed
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.
Problem
Live replies can display stray internal markup or lose visible Unicode characters around reply envelopes. This breaks parity between the streamed answer and the completed answer.
Closes #573.
Root cause
Unicode lowercasing can expand characters, shifting offsets when a lowercased string is searched and the original string sliced. Lowercase equality also disagrees with Python's Unicode case-insensitive regular expressions. After main introduced JSON-aware closing-tag detection (#612), the scanner and malformed-JSON fallback still had these mismatches.
Change
Branch integration and verification
Updated to main
c9c3e9bba34842987b9bbc46aab3e7aa4ca7378e(29 incoming commits) in709f5c0766647b1d63121549e1d9fb89e6d3511busing a non-force merge commit. Compared the resulting tree against main: only five intended files differ; mergeability is restored. Main's Quality and Python compatibility runs passed before integration.The new local reproduction used Python 3.13.5 and an isolated harness transcribing the relevant stream and JSON-closer implementation from the pinned source, with equivalent patch changes. This is not an exact full checkout or the actual repository pytest suite: DNS prevents cloning, and the pinned dependencies/Windows runtime are unavailable locally. The fresh CI runs are required to verify the actual committed code and integration tests. The historical Windows failure may be unrelated but has not been conclusively diagnosed; no timeout assertions, skips, or CI settings have been altered.
Scope and risk
No API schema, dependencies, execution permissions, proposal validation, persistence, generated artifacts, or sandbox tests are changed. Regex patterns are escaped literals; the suffix search is bounded and the JSON scan remains incremental. Coverage floors and required Quality checks are unchanged. Keep this PR draft until fresh verification and maintainer review are complete.
Rollback
Revert the eventual squash commit if a regression is observed. No data migration is necessary.
Historical verification (original PR head)
The original PR description reported 10 failing and 3 passing baseline tests, 13 passing fixed tests, three killed targeted mutants (opening, closing, partial matching), byte-compilation passing and exact-source blob identity. These results apply only to the previous version; they are not claims about the updated head.