Repository navigation
Conversation
loopx-project#9516 added a text-mode subprocess.run for the release-snapshot root probe without encoding=, so it decodes with the locale codec (gbk on zh-CN Windows). tests/test_runtime_subprocess_utf8.py flags it and has been failing on main since. Pin encoding="utf-8" with errors="replace"; only the return code is read, so behavior is otherwise unchanged. Related to loopx-project#9567 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: duang777 <duangjl007@gmail.com>
|
原生 Windows 验证(head
该 head 上 Python 分片因 kernel-contracts 连锁被跳过、无完整套件结果,按惯例不给正式批准;维护者可参考机器人意见与本验证合并。 |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
使用 Antigravity 本地启动器的操作者。 父进程采用非 UTF-8 locale,Python 导入探针的 stdout 或 stderr 含非 ASCII 字节。 同一 US-ASCII 父进程对照里,合法 UTF-8 或坏字节同时出现在 stdout 和 stderr 时,基线抛 UnicodeDecodeError,候选对正确模块来源选择隔离 -m。ASCII 无噪声对照两头都通过。 一个 Python 文件增加两行。未改变运行时的启动协议。 使用 macOS 的真实 C locale 和子进程模拟可移植的非 UTF-8 父进程条件。未在原生 Windows Antigravity 或完整远端 CI 上复跑。 无独立可归因的新增失败。作者提到的 pre-consolidation rollback 路径,本机两头都通过。
改动思路 / Approach
只给探针固定 UTF-8 解码和替换非法字节,在现有导入退出码判定之前保留文本输出。 Antigravity 启动参数生成器继续负责选择解释器和 release bootstrap,导入探针继续核对来源。 一个 Python 文件增加两行。未改变运行时的启动协议。
具体改动 / Changes
精确提交 26102f51fb1c27848c0b206715d1fbaaf0bd32db,基线 811c1a1f66652d3fc3b9830d467e14b45b7423c1。一个 Python 文件增加两行。未改变运行时的启动协议。
- AGY-PROBE-UTF8。同一 US-ASCII 父进程对照里,合法 UTF-8 或坏字节同时出现在 stdout 和 stderr 时,基线抛 UnicodeDecodeError,候选对正确模块来源选择隔离 -m。ASCII 无噪声对照两头都通过。 验收契约
- AGY-ORIGIN-FENCE。错 checkout 的模块来源或子进程退出 17,即使同时写入非 ASCII 或坏字节,候选也走原 release bootstrap。 验收契约
关键代码讲解
- 收集真实子进程 stdout/stderr,固定 UTF-8 并替换坏字节,再按退出码判定。 _python_supports_isolated_module
- 已验证的启动器仍要求 probe 的模块来源属于目标树。 _use_isolated_host_module
- 按 probe 结果沿用隔离模块或 release bootstrap。 build_antigravity_host_runtime_args
对主干的风险 / Risks
定向套件 47 项通过。基线的 UTF-8 规则测试失败,另 5 项通过。Ruff、Git diff 和短预合并 2 项通过。 无独立可归因的新增失败。作者提到的 pre-consolidation rollback 路径,本机两头都通过。 使用 macOS 的真实 C locale 和子进程模拟可移植的非 UTF-8 父进程条件。未在原生 Windows Antigravity 或完整远端 CI 上复跑。
错 checkout 的模块来源或子进程退出 17,即使同时写入非 ASCII 或坏字节,候选也走原 release bootstrap。
我的整体评价 / Verdict
APPROVE。 通过。解码修复保留模块来源与退出码边界。 允许本提案通过独立评审。 使用 macOS 的真实 C locale 和子进程模拟可移植的非 UTF-8 父进程条件。未在原生 Windows Antigravity 或完整远端 CI 上复跑。
English verdict: APPROVE at 26102f5. The real ASCII-locale probe now tolerates UTF-8 and malformed diagnostic bytes. Wrong-root and nonzero-exit probes still fall back. 47 focused tests and two premerge checks passed.
Goal And Delivered Outcome
subprocess.runfor the release-snapshot root probe inloopx/hosts/agy/__init__.pywithoutencoding=, so it decodes with the locale codec (gbk on zh-CN Windows), reopening the Windows non-UTF-8 locale:ghsubprocess output decoded as GBK kills the reader thread and yields a misleadingjson.loads(None)error #4155 class of bug.tests/test_runtime_subprocess_utf8.pyflags it and fails on main.tests/test_runtime_subprocess_utf8.py1 failed → 5 passed.mainat811c1a1f6.Author Declaration
Implemented against
tests/test_runtime_subprocess_utf8.pyat811c1a1f6(text-mode subprocess reads must pin UTF-8).encoding="utf-8"loopx/hosts/agy/__init__.pyrelease-root probetests/test_runtime_subprocess_utf8.pyprobe.returncodeis read, soerrors="replace"cannot change the probe's result; it only keeps a non-UTF-8 byte from killing the reader thread.Scope And Continuation
Validation
26102f51funitpassedtests/test_runtime_subprocess_utf8.py: 5 passed (1 failed on base).unitpassedtest_archive_rollback_to_pre_consolidation_release_preserves_saved_commands) fails identically on base.staticpassedloopx canary premerge --from-git-diff --git-diff-base origin/main: 0 failures.Frontend / Visual Evidence
Type of Change
LoopX Area
Shared-authority RFC fixture impact
N/A
Boundary Checklist
none.Signed-off-bytrailer (git commit -s).🤖 Generated with Claude Code