[BUG] Python edit_file rewrites every CRLF line ending in the file it edits; the Go tool keeps them
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- Go
- Stelle
- 4.5k
- Fork
- 937
- Merge medio
- 1g 10h
- PR unite (30g)
- 150
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di kagent-dev/kagent
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kagent-dev/kagent#3792 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
kagent-dev/kagent#3790 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
kagent-dev/kagent#3789 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] A2A lookups by task or context ID reveal whether another user's resource existsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
kagent-dev/kagent#3787 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Python memory summarization fails for Gemini models: the request has no model nameForse già presa @BahaaMattar l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kagent-dev/kagent#3710 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di kagent-dev/kagent
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
limitlessprojects/Go-Hybrid#4764 ·
I maintainer di solito rispondono entro 1 giorno
-
[bug]: lint fails on main, generated CLI docs out of dateForse già presa @bupd l’ha presa oggi. Apertabug documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
goharbor/harbor-cli#1180 ·
I maintainer di solito rispondono entro 1 giorno
-
crane: mutate --env adds duplicate PATH on Windows images when key case differsForse già presa @aad1tyaaaaa l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
google/go-containerregistry#2523 ·
I maintainer di solito rispondono entro 4 giorni
-
bosh_io_stemcell_type: regular does not work for noble and resolute as it adds -go_agent as suffixAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
cloudfoundry/bosh-deployment-resource#138 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100