Skip to content

fix(onboarding): stop assuming Codex App host - #4884

Merged
huangruiteng merged 5 commits into
loopx-project:mainfrom
Duang777:codex/core-bug-demo-20260922
Sep 22, 2026
Merged

huangruiteng merged 5 commits into
loopx-project:mainfrom
Duang777:codex/core-bug-demo-20260922

Conversation

@Duang777

Copy link
Copy Markdown
Contributor

Problem

register-agent and configure-goal do not know the active host, but both commands reused the Codex App upgrade scanner. A Trae App goal therefore reported codex_app_heartbeat as missing and told the operator to configure Codex App.

Fix

Return a host-neutral selection_required gate from generic registry commands. Keep exact Codex App, Trae App, and other host activation in start-goal and agent-onboard, where the caller supplies the host type.

Validation

  • Added a regression that failed against the old codex_app_heartbeat result and passes with the host-neutral gate.
  • Ran 167 focused host activation, guided start, registration, and fine-grained mode tests.
  • Ran real CLI checks for register-agent, configure-goal, and Trae App start-goal.
  • Ran loopx check: 3898 files scanned, 0 errors, 0 warnings.
  • Ran loopx canary premerge --from-git-diff: 5 selected canaries passed.

Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…0260922

Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
@Duang777

Copy link
Copy Markdown
Contributor Author

@huangruiteng This branch is updated to the latest main. All checks, including merge-gate, pass on exact head 8e7eda6eb0f1d8e8bddab7c2ee603f127206f535. The PR is ready for maintainer review and merge.

…0260922

Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
@Duang777

Copy link
Copy Markdown
Contributor Author

Synced current main into exact head 87a9d0d8184056502bd82dc8542ad471a6e6fc9d without conflicts. The focused fresh-identity regression suite passes 2/2; CI is rerunning on the updated head.

…0260922

Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…0260922

Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
@Duang777

Copy link
Copy Markdown
Contributor Author

Synced latest main@952c1c0ae into exact head 66284f2b28ab59eeef43f43cf7728dbbaa2b202d without conflicts. Fresh focused validation: fresh-identity regressions 2/2 and Ruff passed. The superseded head had already passed both Stage 2C e2e jobs. New exact-head CI is starting.

@huangruiteng huangruiteng 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.

动机

这个 PR 修正 generic onboarding command 的宿主误判。register-agentconfigure-goal 并没有拿到可证明的 Codex App host identity,却复用了 Codex App upgrade scan,导致 Trae 等非 Codex host 也收到“已探测 Codex App activation”的结果。这个输出会把 availability/projection 错当成调用方已经选择的宿主,属于对 operator 有实质误导的默认行为。

改动思路

改动没有猜测另一个宿主,也没有把 generic command 变成 host detector;它把 host-specific activation 留在拥有 agent_type 的 onboarding owner 中,而 generic registry path 只返回 unresolved + selection_required。这是最小且诚实的 contract:先通过 agent type catalog 选择 exact host,再进入相应 onboarding;generic registration 本身不授予或激活任何 host authority。

具体改动

  • registry_admin.py 移除 Codex App-specific build_upgrade_plan / loop_activation_for_goal 依赖。
  • 新增小型 unresolved_host_loop_activation() 投影,明确 schema、host_surface=unresolvedstatus=selection_requiredactivated=false 和下一步操作。
  • register-agent 的 normal/dry-run/write-denied result 与 configure-goal result 统一使用 neutral projection。
  • 重命名并扩展 registration regression,断言 generic command 不再声称 Codex App,且返回可执行的 exact-host selection recommendation。

关键代码讲解

关键设计点不是新增 detector,而是删除错误的 implicit default。host-specific v1 contract 仍由 agent_onboarding.py / host_loop_activation.py 在明确 agent_type 后生成;这里的 v0 summary 只是 generic command 的 readback,并且 activated=false。因此一个可用的 Codex App 安装、某个凭据或现有文件都不会在未经选择时触发宿主 activation。状态值是 exact literal,不依赖 substring denylist 或 prose heuristic,也没有建立第二份持久状态。

对主干的风险

可见行为会变化:generic register-agent / configure-goal 不再默认返回 Codex App activation,而返回 selection required。PR body、测试名和输出 recommendation 都显式披露了 old/new behavior;已经明确走 exact agent_type 的 host-specific onboarding 不变。该 PR 不改 schema persistence、permission、quota、scheduler 或 runtime execution。当前 head 相对最新主干仅落后两个不相交提交,未发现冲突。

验证结果:registration/host suites 114 passed;Pi/unconnected/parity suites 11 passed;changed Python files 的 Ruff 通过;补齐 TypeScript parser dependencies 后 semantic vocabulary smoke 通过;loopx canary premerge --from-git-diff 5/5 通过,无 skip/failure。configure-goal 没有在本 PR 新增一条独立的精确断言,但它复用同一 helper,现有 parity/canary 覆盖未显示回归;这属于低残余风险,不构成阻塞。

我的整体评价

这次修改把 authority 与 capability availability 的边界拉回正确 owner:unknown host 保持 unknown,只有 exact host selection 才进入对应 activation contract。实现规模很小、调用点清楚、默认变化被披露,未发现需要阻塞的 correctness、typed-state、default-off 或兼容问题。我赞成在保持当前 exact head 的前提下合入。

English verdict: APPROVE - head 66284f2; generic onboarding now reports unresolved host selection instead of inventing Codex App activation; 125 focused tests, Ruff, semantic vocabulary smoke, and all 5 selected premerge canaries passed.

@huangruiteng
huangruiteng merged commit 4ebfd6a into loopx-project:main Sep 22, 2026
21 of 25 checks passed
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.

2 participants