Code columns reject valid code when the fence uses a language alias or different case (py, sh, js, Python, SQL)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Priority Level
Medium (Annoying but has workaround)
Describe the bug
LLMCodeColumnConfig rejects valid code when the model labels its fence with a different spelling of the requested language. CodeResponseRecipe (engine/models/recipes/response_recipes.py) compares the fence label to the requested syntax with exact string equality:
if code_block.code_lang and code_block.code_lang != self.syntax:
raise ParserException(f"Responded with code not matching the requested syntax ({self.syntax}).", ...)
So a python column rejects ```Python and ```py, a bash column rejects ```sh and ```shell, javascript rejects ```js, cpp rejects ```c++, go rejects ```golang, and a sql:postgres column (requested as sql) rejects ```SQL and ```postgresql. These are the labels models commonly emit. Each rejection costs a full conversation restart (max_conversation_restarts defaults to 5), and the row is dropped if the model keeps the same label.
Steps/Code to reproduce bug
from data_designer.engine.models.parsers.errors import ParserException
from data_designer.engine.models.recipes.response_recipes import CodeResponseRecipe
cases = [
("python", "```Python\nprint(1)\n```"),
("python", "```py\nprint(1)\n```"),
("bash", "```sh\necho hi\n```"),
("javascript", "```js\nconsole.log(1)\n```"),
("cpp", "```c++\nint x;\n```"),
("go", "```golang\npackage main\n```"),
("sql", "```SQL\nSELECT 1;\n```"),
("sql", "```postgresql\nSELECT 1;\n```"),
]
for syntax, response in cases:
try:
print(syntax, CodeResponseRecipe(syntax=syntax).parse(response))
except ParserException as e:
print(syntax, "->", str(e).splitlines()[0])
On main (861a082) every case fails:
python -> Responded with code not matching the requested syntax (python).
python -> Responded with code not matching the requested syntax (python).
bash -> Responded with code not matching the requested syntax (bash).
javascript -> Responded with code not matching the requested syntax (javascript).
cpp -> Responded with code not matching the requested syntax (cpp).
go -> Responded with code not matching the requested syntax (go).
sql -> Responded with code not matching the requested syntax (sql).
sql -> Responded with code not matching the requested syntax (sql).
Expected behavior
The fence label is compared case-insensitively and common aliases map to the CodeLang name (py -> python, sh/shell -> bash, js -> javascript, ts -> typescript, c++ -> cpp, cs/c# -> csharp, golang -> go, rs -> rust, SQL dialect labels -> sql), so the code above is accepted. A genuinely different language (for example ```js for a python column, or ```cpp for c) is still rejected.
Prior Investigation
Traced the mismatch to CodeResponseRecipe._build_parser_fn; create_response_recipe passes CodeLang.parse_lang(code_lang), and the fence label comes straight from the markdown class attribute in tag_parsers.py with no normalization. The existing tests in tests/engine/models/recipes/test_response_recipes.py only use exact python labels. Searched open and closed issues and PRs for code fence, code_lang, CodeResponseRecipe and requested syntax; #271 added languages to CodeLang but did not touch fence matching.
Proposed fix: normalize both sides (strip, lowercase, small alias table) before comparing in CodeResponseRecipe. Exact labels behave as before. I have the fix and regression tests ready and can open a PR once this is triaged.
Checklist
- I reproduced this issue or provided a minimal example
- I searched the docs/issues myself
- Ngôn ngữ chính
- Python
- Star
- 2.4k
- Fork
- 258
- Merge trung bình
- 4 ngày 20 phút
- Pull request đã merge (30 ngày)
- 32
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA-NeMo/DataDesigner
-
Judge score profiler samples reasoning with squared category weights, crowding out uncommon scoresĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
NVIDIA-NeMo/DataDesigner#1202 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Local seed path containing a single quote breaks the DuckDB queryCó thể đã có người làm @xubenqiang đã nhận 38 ngày trước. Đang mởbug triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
NVIDIA-NeMo/DataDesigner#1102 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enforce \from future import annotations` via ruff FA102 rule`Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởtask
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NVIDIA-NeMo/DataDesigner#760 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
NVIDIA-NeMo/DataDesigner#1205 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
NVIDIA-NeMo/DataDesigner#1203 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA-NeMo/DataDesigner
Issue tương tự
-
docs(contributing): the two things that silently block a PRCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởavailable documentation good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 95/100
Nixitov/Riptide-Native#944 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
JTHCode/secretguard#24 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: middleware documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainer thường phản hồi trong vòng 1 ngày