Skip to content

Fix full-rewrite code fences with CRLF and literal language names - #491

Open
emme1t wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
emme1t:fix/full-rewrite-code-fences
Open

emme1t wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
emme1t:fix/full-rewrite-code-fences

Conversation

@emme1t

@emme1t emme1t commented Sep 19, 2026

Copy link
Copy Markdown

parse_full_rewrite() retains the python fence label when an LLM response uses CRLF line endings, producing code that fails during evaluation. Language names are also interpolated as regular expressions: selecting c++ can extract an earlier c block on Python 3.12.

Escape the configured language name and accept CRLF after the opening fence. Regression tests cover LF/CRLF output, literal language selection, executable extracted Python, and the existing untagged/plain-text fallbacks.

Validation on Windows, Python 3.12:

  • The new regressions fail on upstream 411fb59 in both reported cases; the updated utility suite passes all 14 tests.
  • Full unittest discovery: 429 passed, with 4 failures/errors also reproduced on a clean upstream checkout (426 passed). These concern Windows temporary-file access, worker termination, and absolute-path expectations. Runs used UTF-8 mode and a dummy API key.
  • Black, isort, and git diff --check pass for the changed files. Live-model integration tests were not run.

AI disclosure: Codex generated the patch and tests and performed automated review as part of an Astra Ultra-based automated PR project contributing to the open-source community.

@CLAassistant

CLAassistant commented Sep 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants