Repository navigation
fix(assistant): sync Bot model selection and surface execution failures - #6181
Conversation
Reconcile idle Bot workers with the conversation connection, model and thinking level through the existing configuration authority. Preserve worker history and pending interactions. Publish provider failures through the durable conversation outbox without consuming retries on publication failures. Generated-by: OpenAI Codex
Make model readiness an explicit admission precondition, including replacement wakes created inside recovery. Defer busy workers while preserving wake identity, and keep preparation failures outside ambiguous submission retries. Cover the recovered running-wake transition through the real Host. Generated-by: OpenAI Codex
Share the recovery lifecycle for route synchronization, restart and visible provider failures. Merge overlapping publication and thinking tests, remove the duplicate mocked controller lifecycle, and drop an unreachable failure guard. Generated-by: OpenAI Codex
Use the interaction coordinator as the pending-request authority and restore the unrelated Plugin Agent resume order. Remove unnecessary model discovery from the Host fixture and combine restart routing with current provider failure reporting. Generated-by: OpenAI Codex
The K3 lowest-effort scenario requires a model without an off option. Earlier Host integration tests refresh process metadata from models.dev, whose current K3 declaration now includes none. Install explicit no-off metadata for this case and restore the bundled catalog afterward, while retaining the real request assertions. Generated-by: OpenAI Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
I reviewed all ten changed files at 5d6164bffbc21c67f0f92ef8a9c3945cb9aebcb8. Before a new Bot wake is admitted, the Host now copies the owner's selected connection, model and thinking level into an idle worker through the existing configuration authority, while preserving worker history and permissions. Existing executions and pending interactions defer that update. The controller also publishes preparation and execution failures through the durable conversation outbox and keeps unread input available for a later retry (server/session-catalog-coordinator.ts:424, assistant/bot/controller.ts:172, under packages/runtime-host/src).
One P2 finding: packages/runtime-host/src/assistant/bot/controller.ts:185 publishes unrestricted error text into the user conversation. Provider diagnostics may contain credentials or private Host details, and the existing IM bridge forwards these new assistant messages verbatim. In a controlled integration case, a synthetic authentication diagnostic containing a synthetic API-key marker and private path survived the actual provider-error classifier, Host execution, Bot outbox, conversation ledger, web message projection and Feishu bridge, reaching the captured IM send interface unchanged. Replacing only this visible error interpolation with a generic notice removed both markers. No real credential or external IM service was used. The inline comment describes the required boundary.
The model synchronization and recovery regression passed through the production Host composition; replacing only the synchronization call with a no-op made that same test execute on the previous route and fail. In total, 140 Bot/catalog/service tests, four assistant Host composition cases, 35 interaction/admission tests, 25 IM bridge tests and the three assistant integration groups (83, 24 and 80 tests) passed. They cover route changes, replacement wakes, restart history, pending interactions, preserved worker policy, durable failure publication and retry after fresh input. I found no additional regression in the checked IM admission and delivery paths.
The Kimi test change fixes a metadata-dependent premise rather than weakening the real request assertions. I installed a refreshed K3 declaration that permits none: without the new per-test metadata pin, the existing request assertion failed with thinking === undefined; with the pin it passed. In the complete 42-test execution-model composition file, Kimi passed, while the unchanged Bash live-sandbox-boundary case failed because its tool result omitted the expected workspace path (41 passed, one failed). That Bash assertion also failed in isolation and after restoring all four changed production modules to main. I have not established its underlying sandbox cause and do not attribute it to this PR.
The normal clean root test build, all workspace type checks, production renderer build, lint, formatting, ASF headers, 168 architecture tests, the strict architecture comparison against main, surface inventory, Windows skip inventory and E2E budget passed. The protocol guard found no protocol changes at epoch 225. A trial merge with main b0ed5707ff3dc645c66253ed93e50936e3f9d45d had no conflicts; that merged tree was not tested. At the final status check, exact-head CI run 39362331291 was still in progress.
I did not run the full Runtime Host or repository suite, native Windows/WSL or installer tests, live IM delivery, or paid provider calls. The synthetic provider error and captured IM transport establish the disclosure path without claiming that a real credential has leaked. The P2 should be addressed before merging; CI completion and the merge decision remain with the maintainers.
| id: `bot-error:${id}`, | ||
| turnId: `assistant-output:error:${id}`, | ||
| ts: Date.now(), | ||
| text: `助手消息处理暂时停止:${String(error)}。消息已保留;请检查当前模型和连接,发送新消息可重试。`, |
There was a problem hiding this comment.
[P2] Sanitize failure text before publishing it to the conversation
This interpolation forwards every preparation/execution error verbatim. For completed provider failures, executionFailure supplies the terminal provider message, and the provider classifier truncates that message without redacting secrets. The new assistant bubble is then copied to the conversation ledger and forwarded unchanged by the existing web/IM paths. I reproduced a synthetic invalid-key diagnostic containing a synthetic API-key marker and private Host path reaching the actual Feishu bridge's captured sendMessage argument through the production Host and Bot outbox. This newly sends diagnostic contents to an external messaging service whenever a provider includes such details in an error. Publish a bounded, sanitized user-facing failure notice and retain unrestricted diagnostics locally; apply the same protection to preparation errors caught here.
Publish a fixed retry notice for preparation and execution failures while retaining detailed errors in the local Bot store. Update the existing regressions with synthetic credential and path diagnostics and preserve the current local provider failure check. Generated-by: OpenAI Codex
Merge main at 9afda61. Keep its two Kimi metadata scenarios instead of the older single-scenario pin. Preserve the Bot model synchronization and generic failure notice. Generated-by: OpenAI Codex
English
Summary
Changing the personal assistant's model could leave its hidden Bot using the previous connection and model, with failures invisible in the conversation.
Verification
e53ec1312: the requiredtestcheck passed, including 2,835 passing Runtime Host tests (20 skipped), all 187 assistant integration tests, and CLI release-candidate build/install validation.AI use
Tool(s) and scope: OpenAI Codex implemented, tested, reviewed, and documented this change. This PR was opened by OpenAI Codex at the contributor's request. All commits include
Generated-by: OpenAI Codex.Checklist
Does this PR entail a change in behavior?
简体中文
概述
切换个人助手的模型后,隐藏的 Bot 可能继续使用原来的连接和模型,执行失败也不会显示在聊天中。
验证
e53ec1312的必需test检查已通过:Runtime Host 2,835 项通过、20 项跳过;助手集成 187 项全部通过;CLI 发布候选产物的构建及安装验证通过。AI 使用
工具及范围:OpenAI Codex 完成了实现、测试、审查和说明,并按贡献者要求创建此 PR。所有提交均包含
Generated-by: OpenAI Codex。检查清单
此 PR 是否改变行为?