Skip to content

[Bug] transfer_to_researcher 内置 handoff 工具缺少 provider 配置入口,fallback 到主代理默认模型时静默失败 #8406

@Blueteemo

Description

@Blueteemo

What happened / 发生了什么

在安排主代理将任务委派给子代理时,主代理的第一反应是调用 transfer_to_researcher——该工具名称直观匹配"研究/调研"类任务。但调用后直接报错:

No available channel for model deepseek-v4-flash

排查发现:

  1. transfer_to_researcher系统内置的 HandoffTool,不在 subagent_orchestrator 配置体系中
  2. 用户无法为其配置 provider_id,Dashboard 中也没有任何配置入口
  3. provider_id 为空时,fallback 到主代理的 default_provider_id
  4. 当该默认模型通道不可用(如 503)时,工具直接报错不可用
  5. subagent_orchestrator 中配置的其他子代理(正确配置了可用的 provider)可以正常工作

Reproduce / 如何复现?

  1. 确保主代理的 default_provider_id 指向一个当前不可用的模型通道(如 deepseek-v4-flash 503)
  2. subagent_orchestrator 中配置一个可用的子代理(如 github_agent 配了可用的 claude-sonnet-4-6)
  3. 让主代理调用 transfer_to_researcher 内置 handoff 工具
  4. ❌ 报错:No available channel for model deepseek-v4-flash
  5. 改用 transfer_to_github_agent(subagent_orchestrator 中配置的)
  6. ✅ 正常执行

AstrBot version, deployment method, provider used, and messaging platform used.

AstrBot 4.25.1, Linux Docker (Debian 13 trixie), provider: ChooseC (DeepSeek/deepseek-v4-flash), platform: QQ aiocqhttp

OS

Linux (Debian 13 trixie, Docker)

Logs / 报错日志

报错信息:

No available channel for model deepseek-v4-flash

源码路径 astrbot/core/astr_agent_tool_exec.py:_execute_handoff,provider_id 为空时 fallback 到 get_current_chat_provider_id()

prov_id = getattr(tool, "provider_id", None) or await ctx.get_current_chat_provider_id(umo)

Related: #6873(部分相关,侧重参数校验,未覆盖内置工具)、#7939(相关但解决 tools 注入问题)、#8152(未来可能覆盖此场景)

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coreThe bug / feature is about astrbot's core, backendarea:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.priority: p0

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions