From 75a3038f3389b05d7e200f283a6b685dd1d63d12 Mon Sep 17 00:00:00 2001 From: oliver Date: Sun, 10 May 2026 12:08:42 +0800 Subject: [PATCH] fix(run_command): decode subprocess output as UTF-8 on Windows GBK default decoding failed on curl/wttr.in UTF-8 output, leaving stdout empty with exit 0; use utf-8 + replace. Co-authored-by: Cursor --- runtime/tools/local_sdk/adapter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/tools/local_sdk/adapter.py b/runtime/tools/local_sdk/adapter.py index 94fdddc7..09c2c3ee 100644 --- a/runtime/tools/local_sdk/adapter.py +++ b/runtime/tools/local_sdk/adapter.py @@ -108,11 +108,15 @@ class LocalAdapter: # It only uses explicit cwd; otherwise defaults to data/workspace. workdir = str(resolve_workspace_path(cwd or "data/workspace")) Path(workdir).mkdir(parents=True, exist_ok=True) + # Use UTF-8 for decoded streams: Windows defaults (e.g. GBK) break on UTF-8-only bytes from + # curl/wttr.in, git, ripgrep, etc.; subprocess may leave stdout None after UnicodeDecodeError. run_kwargs: dict[str, Any] = { "cwd": workdir, "shell": True, "capture_output": True, "text": True, + "encoding": "utf-8", + "errors": "replace", "timeout": float(timeout_s), } if os.name == "nt":