Skip to content

fix(agy): pin UTF-8 on the release-root probe subprocess - #9584

Open
Duang777 wants to merge 1 commit into
loopx-project:mainfrom
Duang777:codex/agy-probe-utf8-20261129
Open

Duang777 wants to merge 1 commit into
loopx-project:mainfrom
Duang777:codex/agy-probe-utf8-20261129

Conversation

@Duang777

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Author Declaration

  • Written by: model_agent (Claude Opus, Anthropic), operated by @Duang777

Implemented against

  • Specification and revision: tests/test_runtime_subprocess_utf8.py at 811c1a1f6 (text-mode subprocess reads must pin UTF-8).
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
Text-mode subprocess read pins encoding="utf-8" implemented loopx/hosts/agy/__init__.py release-root probe tests/test_runtime_subprocess_utf8.py
  • Self-check before submission: only probe.returncode is read, so errors="replace" cannot change the probe's result; it only keeps a non-UTF-8 byte from killing the reader thread.

Scope And Continuation

Validation

  • Tested revision: 26102f51f
  • Run state: finished
  • Input classes: none
Check kind Result Public-safe evidence / limitation
unit passed tests/test_runtime_subprocess_utf8.py: 5 passed (1 failed on base).
unit passed agy / antigravity host runtime and hosts consolidation suites: 65 passed, 1 failed; the failure (test_archive_rollback_to_pre_consolidation_release_preserves_saved_commands) fails identically on base.
static passed loopx canary premerge --from-git-diff --git-diff-base origin/main: 0 failures.
  • Coverage and gaps: not run on a non-UTF-8 Windows host.

Frontend / Visual Evidence

  • UI impact: none

Type of Change

  • Bug fix

LoopX Area

  • Host or runtime integration

Shared-authority RFC fixture impact

N/A

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths.
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • No paired RFC changed.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

🤖 Generated with Claude Code

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>
@BigDataDZ

Copy link
Copy Markdown
Contributor

原生 Windows 验证(head 26102f51f)——通过

tests/test_runtime_subprocess_utf8.py 在本机(Windows 10,Python 3.12,zh-CN 区域设置):合并前 main 811c1a1f6 上 1 failed / 4 passed(报 hosts/agy/__init__.py:581);本 head 上 5 passed,与 PR 声明一致。改动正是 #9516 引入的那处 text-mode 探测调用,encoding="utf-8" 加 errors="replace" 两个词。

该 head 上 Python 分片因 kernel-contracts 连锁被跳过、无完整套件结果,按惯例不给正式批准;维护者可参考机器人意见与本验证合并。

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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。 验收契约

关键代码讲解

对主干的风险 / 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants