[BUG] Python edit_file rewrites every CRLF line ending in the file it edits; the Go tool keeps them
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Read python/packages/kagent-tools/src/kagent/tools/shell.py and inspect edit_file_content's file read and write behavior. Add or locate a regression test using CRLF bytes, then verify a one-line edit preserves the other line endings; the issue's linked pull request #3744 shows work is already underway.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Description
edit_file_content (python/packages/kagent-tools/src/kagent/tools/shell.py, used by the ADK and OpenAI Agents runtimes) reads the file with universal newlines and writes it back with write_text, so a one-line edit turns every \r\n in the file into \n. The Go runtime's edit_file replaces bytes and leaves the rest of the file alone.
Steps To Reproduce
(default branch d5c04c17, no cluster needed)
f.write_bytes(b"$a = 1\r\n$b = 2\r\n$c = 3\r\n")
edit_file_content(f, "$b = 2", "$b = 20")
f.read_bytes()
Expected Behavior
b'$a = 1\r\n$b = 20\r\n$c = 3\r\n' (what the Go tool produces for the same edit).
Actual Behavior
b'$a = 1\n$b = 20\n$c = 3\n' for a one-line edit. All three line endings changed. Through the real EditFileTool the output is the same.
Impact/Severity
Minor inconvenience (silent change of every line in the file: noisy diffs, breaks files that must stay CRLF such as .bat or .ps1).
- Ngôn ngữ chính
- Go
- Star
- 4.5k
- Fork
- 937
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 150
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không 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 kagent-dev/kagent
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kagent-dev/kagent#3792 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kagent-dev/kagent#3790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
kagent-dev/kagent#3789 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] A2A lookups by task or context ID reveal whether another user's resource existsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
kagent-dev/kagent#3787 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Python memory summarization fails for Gemini models: the request has no model nameCó thể đã có người làm @BahaaMattar đã nhận 6 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kagent-dev/kagent#3710 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của kagent-dev/kagent
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
limitlessprojects/Go-Hybrid#4764 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug]: lint fails on main, generated CLI docs out of dateCó thể đã có người làm @bupd đã nhận hôm nay. Đang mởbug documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
goharbor/harbor-cli#1180 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
crane: mutate --env adds duplicate PATH on Windows images when key case differsCó thể đã có người làm @aad1tyaaaaa đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
google/go-containerregistry#2523 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bosh_io_stemcell_type: regular does not work for noble and resolute as it adds -go_agent as suffixĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
cloudfoundry/bosh-deployment-resource#138 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100