fix(onboarding): stop assuming Codex App host - #4884
Conversation
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…0260922 Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
@huangruiteng This branch is updated to the latest |
…0260922 Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
Synced current |
…0260922 Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
…0260922 Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
|
Synced latest |
huangruiteng
left a comment
There was a problem hiding this comment.
动机
这个 PR 修正 generic onboarding command 的宿主误判。register-agent 与 configure-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-specificbuild_upgrade_plan/loop_activation_for_goal依赖。 - 新增小型
unresolved_host_loop_activation()投影,明确 schema、host_surface=unresolved、status=selection_required、activated=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.
Problem
register-agentandconfigure-goaldo not know the active host, but both commands reused the Codex App upgrade scanner. A Trae App goal therefore reportedcodex_app_heartbeatas missing and told the operator to configure Codex App.Fix
Return a host-neutral
selection_requiredgate from generic registry commands. Keep exact Codex App, Trae App, and other host activation instart-goalandagent-onboard, where the caller supplies the host type.Validation
codex_app_heartbeatresult and passes with the host-neutral gate.register-agent,configure-goal, and Trae Appstart-goal.loopx check: 3898 files scanned, 0 errors, 0 warnings.loopx canary premerge --from-git-diff: 5 selected canaries passed.