Skip to content

fix(assistant): save the Bot model as new workers' default - #6703

Merged
M4n5ter merged 2 commits into
apache:rust-previewfrom
sunrioa:codex/fix-bot-worker-default-model
Nov 9, 2026
Merged

M4n5ter merged 2 commits into
apache:rust-previewfrom
sunrioa:codex/fix-bot-worker-default-model

Conversation

@sunrioa

@sunrioa sunrioa commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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_model resolution 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

  • Extended the existing Bot delegation integration test to check the created and observed backend, the actual delegated request model, direct continuation using the saved default, and subsequent explicit model selection.
  • Confirmed the regression fails before the production change and passes afterward.
  • Full maka-agent-native library 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

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex assisted with investigation, implementation, the regression-test extension, local validation, and this description.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No
简体中文

概述

关联 #6642。

Bot 创建的原生工作会话可能保存一个与实际执行模型不同的模型偏好。例如,工作会话面板显示 GPT,但 Bot 派发的请求实际使用 DeepSeek;用户直接追问时,又会使用保存的 GPT 偏好。

在初始化工作会话的默认模型配置时,复用现有的 use_bot_model 解析逻辑。新 Session 因而会保存 Bot 委派已经采用的连接和模型,使界面显示的默认值与直接追问使用同一份配置。

本次改动仅涉及初始配置。已有会话保留原先保存的偏好,用户之后仍可主动选择其他模型。普通会话创建和显式选择外部执行器的行为保持原样。

验证

  • 扩展现有 Bot 委派集成测试,检查创建结果和观测接口返回的默认模型、实际委派请求的模型、直接续聊是否使用保存的默认值,以及之后主动改选模型的行为。
  • 确认回归测试在生产代码修改前失败,修改后通过。
  • maka-agent-native 完整库测试:360 项通过,4 项原有的显式忽略测试。这些测试需要手动诊断,或真实且已认证的运行时/探测输入。
  • cargo fmt --all -- --check:通过。
  • git diff --check:通过。

运行验证使用本地模拟供应商和真实 Host 创建、发送路径。本次补丁未运行完整桌面 E2E 或真实供应商测试。

AI 使用说明

  • 生成式工具未作出实质性贡献
  • 生成式工具作出了实质性贡献

工具及范围:Codex 协助完成调查、实现、回归测试扩展、本地验证和本说明起草。

检查清单

  • 测试覆盖本次改动,并确认在缺少修复时失败
  • 格式、类型检查及受影响的测试套件在本地通过

本 PR 是否改变行为?

  • 是,已在概述中说明
  • 否

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

@Astro-Han Astro-Han left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added the effort/S Under 100 readable lines label Nov 9, 2026
…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
@M4n5ter
M4n5ter merged commit ee7e906 into apache:rust-preview Nov 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants