Repository navigation
fix(chat): keep steward account routing with an existing host login - #8049
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: actor_kind=model_agent; model=GPT-6 (Codex); provider=OpenAI; self_reported (host execution observation unavailable).
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
当前 exact head b40004c9982c2e775f46bee23853354a562c20d5 无阻塞发现。完整审阅两文件差异、现有认证守卫和原 worker 调用;一行生产修复没有增加授权、模型候选或恢复次数。
动机 / Motivation
使用已有 Codex 登录并配置管家 API primary 的原私聊用户和原回复 worker。 原 host auth.json 存在且 review 仍使用同一 home:旧实现不调用 API route;现在同一原 worker 请求明确选择 steward consumer 和配置模型的 API provider。 只有实际不同的 native home 才传给独立认证守卫;同一 host home 沿当前配置选择管家 API route,独立登录的隔离项目仍保留原选择。 不切换原生登录,不改 API/订阅候选集或 worker 优先级,不授予新宿主/网络权限,不重放业务。 本修复资格是账户路由判断及普通安装采用;不把模型可读、路由可用或本地测试当成真实账户余额,也不代替每条历史问题的实质答案和原受众回传验收。
改动思路 / Approach
复用既有 prepare_api_transport、NativeAccounts.model_transport、consumer 区分和 CodexApiTransport,不新增 selector、fallback 策略、凭据副本或权限。 permissions_profile 描述工具边界,不能据此断言 native home 独立。调用点已经同时拥有解析后的 base_home 和 runtime_home,直接比较二者即可消除错误分类。独立目录有自己的认证时,原守卫继续保留它;不通过拷贝认证、继承代理环境或重开原业务补救。
具体改动 / Changes
CodexChatAgentSession.start(loopx/chat_agent.py:824)仅把 isolated_home 条件改为实际路径不同;consumer、model、eligible、账号 owner 和 native permission 配置保持原样。prepare_api_transport(loopx/capabilities/native_chat/codex_auth.py)实现未改,其独立登录拒绝 host 借用逻辑仍有效。新 authenticated-host 原 worker 用例补上真实漏测前提:host 有 auth.json 且 review 使用同一 home,断言 route 被调用一次、consumer=steward、模型和 native modelProvider/loopback URL 正确,以及认证文件逐字不变。
规范 docs/architecture/rfcs/capable-manager-semantic-handoff-v0.md,不可变 revision d29ec8bf2a105aac24629bcbf3dfb7c97aea51fe:existing-consumer-route 和 independent-auth-store 由正反例覆盖;installed-adoption 留给正常安装和实际加载源码/route 读回,不把源代码测试类推成真实消息已完成。
对主干的风险 / Risks
最强反例是独立项目认证被 host API 路由覆盖。实际不同目录仍传入同一个未修改的认证守卫,原 20 项认证测试通过;普通 worker 的 consumer/role 及登录选择均未改。此前 fake host 没有 auth.json,才使已有恢复测试漏过真实分支。新用例在旧源码明确失败于 api_calls=[],修复后通过,且不运行真实付费推理。53 affected answer/model tests and 20 native authentication cases pass; the new same-host-login regression fails before the one-line fix and passes after it. Final committed-head standard premerge: 6 direct and 2 selected checks, no failure/hold. 没有提高模块预算或放宽断言。
语义与 CI 对齐
无新增状态、CLI、指令或默认关闭功能,default-off 不适用;修复既有 isolated_home 语义,read-only sandbox 和所有原 source/stop/recovery 保护不变。按 wait_for_ci=false 没有查询或等待远端 CI。实际账户余额、网络可用性和历史问题的业务结论不在本地合成测试证明范围。
我的整体评价 / Verdict
long_horizon 与 user_experience 均改善:已配置的管家路由在最常见的已登录 host 情况下也能实际采用,避免再次引入另一账号选择器或无声绕路。实现是现有 caller 的最小修正,测试覆盖导致真实故障的前提。没有界面视觉变更,视觉审查不适用。本修复资格是账户路由判断及普通安装采用;不把模型可读、路由可用或本地测试当成真实账户余额,也不代替每条历史问题的实质答案和原受众回传验收。
English verdict: APPROVE b40004c; actual native home identity now preserves the configured steward API route without borrowing independently authenticated stores or changing worker policy.
A restricted steward answer review reused the original native Codex home, but treated that same home as an independently authenticated isolated store. With a normal host login present, this skipped the configured steward API-primary route and attempted the unrelated native subscription transport instead.
Pass an isolated-home authentication guard only when the native process actually uses a distinct home. Independently authenticated project stores keep their existing behavior; worker routing, original auth files, read-only permissions and account candidates are unchanged.
Validation: the new original-worker regression fails before the fix and passes after it, asserting the steward consumer, configured model/provider/loopback route and byte-identical host auth. 53 affected answer/model tests, 20 native authentication tests, Ruff and final standard premerge (6 direct plus 2 selected checks) pass. Real business answers and provider delivery remain separate acceptance.