Repository navigation
fix(assistant): save the Bot model as new workers' default - #6703
Conversation
Initialize new Bot-created native sessions with the same admitted model resolution already used for delegated execution. The saved connection and model now match the worker's initial execution and direct continuation. Extend the existing delegation regression to check persisted and observed defaults, provider requests, direct continuation, and explicit model changes. Refs apache#6642 Generated-by: Codex
There was a problem hiding this comment.
I reviewed both changed files at 54579af903a89cabddfd628295c9a38e6eb0a91b, the existing use_bot_model resolver, and the creation/send paths that consume the stored backend.
No confirmed P0–P2 finding. Creation now resolves the initial backend through the same Bot admission used for delegated sends, then persists that resolved value in the new session configuration. The helper preserves explicit executor selection and thinking level, and leaves ordinary identities or failed Bot-route lookup unchanged. It changes initial creation rather than rewriting existing session preferences.
I ran the actual extracted production resolver through 18 controlled identity/backend/route cases, covering non-Bot callers, missing/requested model backends, explicit executors, successful model override and failed route lookup. These use controlled service adapters and do not constitute a local Host integration run.
The current hosted integration test the_bot_delegates_to_ordinary_sessions_and_controls_only_its_own passes in 5.279s, in native shard job 128645543681. I read its new checks for the created and observed saved backend, actual delegated request model, direct continuation without an override, and subsequent explicit model selection. Its hosted checkout tree matches this head merged with 11c06b12. The author's full 360-test local result remains attributed to the author.
This head also merges without conflicts into the updated rust-preview target 6fd77053. macOS job 128642259019 fails at the first desktop text-entry case (67.954s, observed: Null), also failing on the earlier base 42447608116; I have not established this PR as its cause. At inspection, Windows/remaining CI work was still unfinished. I did not run live providers, the full desktop interface or real restart recovery. No schema or wire-format changes.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
…and scope thinking level Normalize Bot-created worker backends before checking availability so session creation validates the persisted backend rather than a discarded foreign native selection, return the resolved preference by value, and retain thinking_level only when the requested native model already matches the Bot's admitted model. Refs apache#6642 Generated-by: Antigravity
Summary
Refs #6642.
A Bot-created native worker could save a different model preference from the model used for its execution. For example, its pane could show GPT while Bot-dispatched requests used DeepSeek. A direct follow-up would then use the saved GPT preference.
Apply the existing
use_bot_modelresolution when initializing the worker’s saved backend. The new Session therefore starts with the connection and model already adopted by Bot delegation, so its displayed default and direct follow-up use the same configuration.The change is limited to initial configuration. Existing sessions keep their saved preferences, and users can still select a different model afterward. Ordinary session creation and explicit executor selection retain their existing behavior.
Verification
maka-agent-nativelibrary suite: 360 passed, 4 existing explicitly ignored tests. The ignored tests require manual diagnostics or real authenticated runtime/probe inputs.cargo fmt --all -- --check: passed.git diff --check: passed.Runtime verification used local mock providers and the actual Host creation/send paths. Full desktop E2E and live-provider testing were not run for this patch.
AI use
Tool(s) and scope: Codex assisted with investigation, implementation, the regression-test extension, local validation, and this description.
Checklist
Does this PR entail a change in behavior?
简体中文
概述
关联 #6642。
Bot 创建的原生工作会话可能保存一个与实际执行模型不同的模型偏好。例如,工作会话面板显示 GPT,但 Bot 派发的请求实际使用 DeepSeek;用户直接追问时,又会使用保存的 GPT 偏好。
在初始化工作会话的默认模型配置时,复用现有的
use_bot_model解析逻辑。新 Session 因而会保存 Bot 委派已经采用的连接和模型,使界面显示的默认值与直接追问使用同一份配置。本次改动仅涉及初始配置。已有会话保留原先保存的偏好,用户之后仍可主动选择其他模型。普通会话创建和显式选择外部执行器的行为保持原样。
验证
maka-agent-native完整库测试:360 项通过,4 项原有的显式忽略测试。这些测试需要手动诊断,或真实且已认证的运行时/探测输入。cargo fmt --all -- --check:通过。git diff --check:通过。运行验证使用本地模拟供应商和真实 Host 创建、发送路径。本次补丁未运行完整桌面 E2E 或真实供应商测试。
AI 使用说明
工具及范围:Codex 协助完成调查、实现、回归测试扩展、本地验证和本说明起草。
检查清单
本 PR 是否改变行为?