Skip to content

fix(traex): reuse runtime thread and retain native Goal continuity - #8673

Merged
cocolord merged 1 commit into
mainfrom
codex/rfc-entry-replan-20261113t060120
Nov 13, 2026
Merged

cocolord merged 1 commit into
mainfrom
codex/rfc-entry-replan-20261113t060120

Conversation

@cocolord

@cocolord cocolord commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

TraeX supplies a stable thread ID, but guided entry discarded it and asked an already bound user to select an Agent again. The shared host adapter now consumes that ID in the existing traex-cli binding scope. Native Goal activation guidance first reads the current Goal, preserves its original objective on continuation, and uses the visible /goal fallback when tools/context are unavailable.

Unknown, fresh, foreign-host and conflicting contexts keep the existing identity fences; explicit thread selection still takes precedence. This closes a concrete RFC R1 entry gap. Real model adoption, complete cost evidence and full original-goal regression remain open.

Validation for 4f28d48b6a5bcfe0a5d56d32f74cb5855a6f8125:

  • Source owner regression: 215 passed; final activation regression: 86 passed.
  • Isolated installed core, managed recovery and context regression: 23 passed on Python 3.11.15.
  • Source/base-core/head-core File/SQLite comparison: 36 calls; exact objective and canonical state retained. The new source and installed regressions fail on the base's missing TraeX thread.
  • All 1,887 packaged runtime files match source; bilingual RFC and candidate public-boundary scans pass.
  • Final catalog premerge: 14 executed, 0 failures. The first run failed because TypeScript development dependencies were absent; that attempt is retained, and the complete gate passed after preparing the environment. No whole-R1 or performance qualification is claimed.

The bounded refactoring pass found no additional abstraction necessary: this extends the existing host-context owner and reuses the existing identity/lifecycle rules.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

@cocolord cocolord left a comment •

Copy link
Copy Markdown
Member Author

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 | OpenAI | self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

TraeX 用户继续已有任务时,已有线程和身份本应足以继续实际任务。TraeX 用户继续已有任务时,线程已绑定但普通入口仍要求选择身份;修复后省略身份参数即可复用原 Agent。 这个问题会重复增加选择和复制参数的工作,并不能提供新的身份授权。真实 CLI 对照证明已绑定线程可自动续接,显式覆盖仍有效,未知线程与冲突仍被隔离。 本 PR 不取得整个最小内核或模型效果资格。 真实模型采用、完整最小闭包与成本、完整 R1 和原始目标回归仍待验收。

改动思路 / Approach

环境读取留在已有 Host adapter,身份规则留在原绑定 owner,原生 Goal 操作留给 Host;没有第二套生命周期或状态。 本 PR 完成线程续接入口、激活指引与对应源/安装回归;模型采用和完整 R1 仍由后续同一验收路径负责。 最小可行修复是在既有环境映射中补上当前 Host,再让已验证的绑定决定身份;保留显式参数作为合法覆盖。继续要求用户传入已知线程虽可恢复,但没有消除原始入口摩擦。新增 executor 或持久状态反而会重复已有控制面。

原生 Goal 的激活是交给 Host 执行的指令投影。先读取当前 Goal/context;同线程续接保留原目标,paused/blocked/completed 不得未经用户方向恢复。仅获授权的新启动且确认没有已有 Goal 才创建并验证;工具/context 不可用时才使用原可见恢复路径。Python 不执行这些原生工具,工具存在也不等于授权或已经激活。

具体改动 / Changes

本次评审固定在 8673@4f28d48b6a5bcfe0a5d56d32f74cb5855a6f8125。验收依据是 docs/architecture/rfcs/monorepo-distribution-split-v0.md 的 09886ba7afec07dba709229cc9dfb7fabf15d03a,不是为迎合实现新增的检查点。V1、V2、V3、V4、V5、V10 的完整验收均继续 deferred;本次证明的是其中 Host 线程入口与指令边界的实际增量,不能把测试数量解释成 R1 完成。

关键代码讲解

  1. ambient_host_thread_id 仍按选定 Host 精确读取环境,不猜测另一个 Host 的变量。新增映射让 TraeX 的真实线程进入已有 resolve_thread_agent_binding;同名的 Trae App 绑定仍不构成 TraeX 授权。current_host_thread_id 保持显式值优先。
  2. _traex_activation 保留原生 Host 生命周期和手工兼容入口,纠正先前直接替换可见目标的指引。read/retain/fresh-create/manual-fallback 的条件、停止要求和后续 quota 门均已逐条对照,实际模型采用仍 unverified。
  3. 源测试覆盖已有绑定、显式覆盖、新线程、缺失环境、跨 Host 和冲突;安装测试通过实际 bootstrap/register/bind/续接路径证明省略线程参数仍复用原身份。双语 RFC 记录当前证据和仍未完成的原验收,未新增共享状态、协议 owner、CLI 参数或新能力。

对主干的风险 / Risks

最强反例是把未知/跨 Host 的线程当作 takeover,或因可用 Goal 工具而改写已有目标。源码正负例和 File/SQLite 对照验证前一边界;后一边界通过完整生成指令和当前原生 Goal 只读回读检查,不能代替真实模型采用测试。OS 用户可改变自己的环境,因此这保持原 trusted-local-runtime 边界,不能称为跨进程认证。

验证 PASS:源码 owner 回归 215 项,最终 activation 回归 86 项;不可变安装包的 core/managed recovery/context 回归 23 项;三个来源、两种真实后端共 36 次调用,目标原文、registry/state 字节与 canonical revision 保留,1,887 个 runtime 文件与源码字节一致。源码和安装包基线均复现缺失线程,显式对照成功,修复后的对应回归通过;另外六个 Host activation packet 与基线完全一致。

最终 premerge PASS,14 项全执行、0 失败,双语检查、语法、公共边界与语义检查通过。第一次 premerge 的 TypeScript 开发依赖缺失失败保留;补齐 npm 环境后重跑完整 unchanged head 门禁。公共边界子检查通过,组合 check 的其他 Goal 健康诊断没有被算作通过或在本 PR 改写。CI 部分排队/运行,不能写成全部成功;合入仍需最后 readiness、线程与 head 回读。

补充 lint 检查按 CI 实际命令范围通过,dependency-lock/top-level-module invariants 也通过。无路径限定的全仓 Ruff 检查发现 132 项问题;在不可变 base 与此 head 上逐一核对文件、错误码、位置和消息,全部相同。这些额外诊断保持 failed/pre_existing_unrelated,不被算作成功,也不扩大本 PR 修复范围。

最后 readiness 出现 browser (2/3) 失败:goal-hierarchy 场景在工作区导航后丢失 research_lens,实际 null、预期 graph。用同一单场景 browser 命令,在不可变 base 与本 head 的源码模式均复现同一断言、位置和结果;该导航实现与浏览器夹具未在本 PR 改动。此处只证明既有导航失败与本 PR 入口修复分离,未重标 CI 为成功,也未宣称整个 Linux packaged run 通过;原目标仍保留此缺口。随后 release build 在 dependency-result guard 因 BROWSER_RESULT=failure 退出,尚未进入实际构建;这是同一浏览器失败的传播,仍不称为构建成功。

我的整体评价 / Verdict

结论 APPROVE:这项增量修复了可复现的真实入口缺口,并保持原控制面 owner。没有用绿色测试掩盖新状态或权限变化。环境读取留在已有 Host adapter,身份规则留在原绑定 owner,原生 Goal 操作留给 Host;没有第二套生命周期或状态。 本 PR 完成线程续接入口、激活指引与对应源/安装回归;模型采用和完整 R1 仍由后续同一验收路径负责。 同域重构检查认为额外抽象 unnecessary,现有映射和 resolver 已是合适边界。

CLI/Host instruction repair; no rendered presentation changes in the inspected diff. 真实模型采用与完整产品旅程未验证。因此本次无需新的界面截图;原模型/Host request、correction、pause/resume、accepted-result、完整成本与整个 Goal 回归仍开放。回滚可直接 revert,不需状态迁移;保留显式线程和手工恢复能力。正式 GitHub 自审批不可用,使用作者持有 PR 的 COMMENTED 批准结论;它不替代 maintainer merge authority。

English verdict: APPROVE — 4f28d48. The real source/installed TraeX entry now reuses its scoped runtime thread; explicit, unknown, foreign-host, conflict and replay boundaries are preserved. Source/installed regressions and final premerge pass. Full model adoption, complete cost and original-goal qualification remain open; CI/readiness is separate.

@cocolord
cocolord merged commit bbf8788 into main Nov 13, 2026
23 of 47 checks passed
@cocolord
cocolord deleted the codex/rfc-entry-replan-20261113t060120 branch November 13, 2026 07:22
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.

1 participant