Skip to content

Read synthetic delegation Host input as UTF-8 - #8365

Merged
2 commits merged into
mainfrom
codex/small-kernel-host-utf8-20261108T1004
Nov 8, 2026
Merged

2 commits merged into
mainfrom
codex/small-kernel-host-utf8-20261108T1004

Conversation

@cocolord

@cocolord cocolord commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

The synthetic delegation Host inherits a locale decoder on Windows CPython 3.11 even though its existing parent transport sends UTF-8 JSON. Unicode input can therefore fail the Host before the independent artifact validator runs, leaving the original-task recovery cases without task_failure.

Configure only the fixture Host's stdin as UTF-8. A File/SQLite regression simulates CP1252 in that child, rejects an invalid artifact, repairs it and revalidates the cached result with the original turn key and exactly one Host invocation. Related to #8360; target main, author baseline 4e949f405528fd8087f0623526c62f890c1ce982.

Author Declaration

  • Written by: model_agent — TRAE / GPT-6.
  • Specification: docs/architecture/rfcs/monorepo-distribution-split-v0.md §9 V4 and the existing generic Host transport / original-task revalidation contracts at the author baseline.
Criterion Disposition Path Evidence
Consume the existing UTF-8 pipe protocol implemented tests/test_local_delegation.py::HOST Same-environment immutable baseline Host fails the new oracle; corrected Host passes.
Preserve original task identity and avoid a second Host execution during artifact repair implemented New File/SQLite regression and tests/test_delegation_task_revalidation.py Source and isolated-wheel recovery checks below.
Preserve failure and remaining acceptance boundaries implemented Paired RFC non-normative checkpoint Original Windows and Frontstage failures retained; no performance or full-kernel claim.
  • Self-check: inspected the actual transport and validation owners, baseline sensitivity, complete recovery suites, package provenance, paired translation and public boundary. The adjacent refactoring pass found no additional extraction warranted: the encoding fix belongs to the existing source-owned Host fixture. No production rule, persisted state, protocol vocabulary or default Host environment changes.

Scope And Continuation

Complete fixture correction with a durable regression and paired qualification record. The parent minimal-kernel program stays open for complete provider-first transaction, PostgreSQL host/wheel, complete costs and adoption acceptance. Retain I3 for at least one minor release and all historical/frozen failures. #8360 retains its own exact-head review/CI gates. Native Windows verification of this new head remains pending; the prior failed run is retained. This proposal does not merge or upgrade an installed Host.

Validation

  • Tested fixture commit: a4ce613585fdb329ba3600f0ede768864214ed84; final paired-doc head: 107c4fab80406a96bb0f6ccfd62b47230034d2fc.
  • Run state: finished locally; CI pending after submission.
  • Input classes: synthetic, public_fixture.
Check kind Result Public-safe evidence / limitation
regression_parity passed CPython 3.13.5 / Node 22.22.3 on macOS arm64: replacing only the corrected fixture HOST with the immutable baseline makes the Unicode task-validation oracle fail. The corrected File/SQLite cases both pass. Earlier invalid probe preparations are retained separately.
integration / real_entrypoint passed tests/test_local_delegation.py plus tests/test_delegation_task_revalidation.py, CPython 3.13.5 / Node 22.22.3, 81 cases pass using temporary File/SQLite stores and synthetic subprocess Hosts.
integration / real_entrypoint passed CPython 3.11.15 / Node 22.22.3 source: new two provider cases plus all 12 existing original-task recovery cases pass, including MCP disconnection and lock-timeout recovery.
integration / real_entrypoint passed Fresh isolated monolithic wheel, CPython 3.11.15 / Node 22.22.3: the same 14 cases pass. Wheel imported before source-owned fixtures; all 1,920 present packaged tracked runtime entries match the source. The same 17 source-only exclusions remain: canary baseline, host plugin/config, fault-test helper and documentation/media.
static passed Ruff and paired staged RFC check; diff advisory introduces no shared vocabulary. Public-boundary subcheck passes for the three candidate files. Full local loopx check still fails on unrelated registered-Goal authority errors; private diagnostic contents are excluded.
static / integration passed Standard diff-derived loopx canary premerge --from-git-diff --git-diff-base origin/main: all five direct and 11 selected checks complete, zero blocking failures. The unchanged module-metric ceiling finding in loopx/extensions/lark/private_conversations.py is reported as an inherited advisory. The first attempt failed because this new worktree lacked TypeScript dev dependencies; npm ci --ignore-scripts prepared them, and the unchanged-head rerun passes. No gate was relaxed.
integration not_run New exact-head native Windows CI pending. The original #8360 Windows arm has six recovery failures. Its independently retried Frontstage manifest request still returns HTTP 504. #8360 also retains separate digest-declaration and selected-owner loading failures; this fixture correction does not resolve those gates.

The changed fixture is exercised through the real generic Host subprocess transport and real temporary File/SQLite providers. No model or real-agent execution, PostgreSQL host/wheel qualification, performance campaign, split installation or installed adoption is claimed. Existing recovery and failure classification remain intact.

Frontend / Visual Evidence

UI impact: none. No UI or documentation chrome changes; screenshots and preview are not applicable.

LoopX Area

  • Host or runtime integration
  • Public docs or presentation surface (RFC evidence only)

Shared-authority RFC fixture impact

N/A: no TypeScript migration or shared-authority production change.

Boundary Checklist

  • Public-safe diff/body; no private state, credentials, raw traces, internal links or local paths.
  • Scoped fixture repair; no competing implementation or benchmark work.
  • Both English/Chinese RFC files change together.
  • UI impact marked none.
  • Every commit includes a DCO sign-off.

cocolord and others added 2 commits November 8, 2026 18:08
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
@mergify

mergify Bot commented Nov 8, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @cocolord.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 8, 2026

@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.1-sol | OpenAI | runtime_reported | reasoning_effort=max

APPROVE。已验证合成 Host 的两条恢复路径,整合时仍需处理双语 RFC 冲突。

精确 head 107c4fa

动机 / Motivation

维护原任务恢复的开发者,需要让测试 Host 先正确读到请求,再验证无效产物能否在原轮次重验。父进程通过管道发 UTF-8 JSON。若测试 Host 用 CP1252 读取,Unicode 内容会在验证前出错。显式设定 UTF-8 后,同一请求可到达产物验证。File 和 SQLite 均验证了失败分类、修复产物后接受原轮次结果,以及 Host 只执行一次。本切片覆盖合成 Host 和本地恢复验证。完整 V4、原生 Windows、拆分安装与成本仍待独立验收。目标 main 的两份 RFC 发生冲突,需保留两边的证据条目后重新验证新提交。

改动思路 / Approach

真实 generic Host 管道已明确发送 UTF-8。修复落在现有测试脚本中,避免改动生产解码和失败分类。回归先把合成子进程切成 CP1252,再送入原来的 UTF-8 请求和有意无效的产物。恢复沿用既有 validator 和缓存结果入口。

具体改动 / Changes

完整差异只有双语 RFC 与既有测试。测试 Host 在 json.load 前配置 stdin 编码。File、SQLite 用例分别断言拒绝中有 revalidate_cached_result,修复原产物后接受结果,轮次标识和 Host 调用次数不变。两份 RFC 保留原 Windows 和 Frontstage 失败,也明确了作者 source/wheel 证据的范围。

关键内容讲解

  1. 合成 Host 在读取 JSON 前设置 UTF-8。父进程原有的 UTF-8 编码和真实子进程边界保留。 合成 Host L43

  2. 双 provider 回归先制造可识别的失败,再走缓存重验。把旧 Host 字符串换回同一套测试时,两个用例均在缺少 task_failure 的断言处失败。 双 provider 回归 L104

规格映射 V4 的完整验收 deferred,Fixture-UTF8 implemented。。依据不可变版本 4e949f4。 docs/architecture/rfcs/monorepo-distribution-split-v0.md

对主干的风险 / Risks

本地 CPython 3.11.17 两套完整回归 81 passed。仅置换不可变 base 的合成 Host 时,两条新用例按预期失败。候选的测试覆盖了真正的进程传输和 File/SQLite 状态,测试没有代填 validator 结果。原生 premerge 通过。Lark 模块上限的继承 advisory 在相同 base/head 输出一致,原阈值保持。

实际合并基线为 4e949f4。对本次获取的目标 main 做 Git 三方检验,两份 RFC 均有内容冲突,测试文件无冲突。原生 Windows 和独立 wheel 资格仍属于各自验证范围。

我的整体评价 / Verdict

这个切片可独立恢复合成 Host 的测试覆盖。#8360 当前也携带相同的 Host 修复和测试,整合时应只保留一份。#8360 还包含独立的加载与浏览器中断变更。双语文档冲突属于整合门。 关联提案 #8360 长程影响判为 improved,恢复验证能覆盖原用例。用户体验不适用,既有 CLI 与页面未改。变更限于测试和证据,无页面展示改动。未验证原生 Windows、安装采用及长期成本。

English verdict: APPROVE — 107c4fa. The synthetic Host keeps UTF-8 task recovery reachable.

@huangruiteng huangruiteng closed this pull request by merging all changes into main in e37a1d6 Nov 8, 2026
@huangruiteng
huangruiteng deleted the codex/small-kernel-host-utf8-20261108T1004 branch November 8, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Mergify: the pull request has merge conflicts with its base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants