Skip to content

[Bug]: The fallbackModel feature is not working. #1850

Closed

Description

@amyaxy

AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.

Image Image

Describe the bug

ReActAgent 当主模型不可用时,没有切换到备用模型

To Reproduce
Steps to reproduce the behavior:

  1. You code
  2. How to execute
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Error messages
Detailed error messages.

Environment (please complete the following information):

  • AgentScope-Java Version: 2.0.0-RC4
  • Java Version: 21
  • OS: windows

Additional context
Add any other context about the problem here.

Activity

  1. added
    bug
    on Jun 22, 2026
  2. itxaiohanglover commented on Jun 22, 2026

    @itxaiohanglover
    Contributor

    I looked into this. The fallbackModel feature was added in PR #1851, but the wiring seems incomplete — when the primary model fails, the fallback is not actually triggered.

    My plan to fix:

    1. Reproduce by configuring a fallbackModel with an invalid primary model
    2. Trace the exception flow in ReActAgent to find where the fallback is skipped
    3. Fix the wiring so the fallback model kicks in on primary model failure

    Could you assign this to me? Please

  3. added
    area/core/agent
    on Jun 22, 2026
  4. guslegend0510 commented on Jun 22, 2026

    @guslegend0510
    Contributor

    感谢提醒。你说得对,之前的版本里 fallbackModel 只是配置进去了,但没有真正接入运行时调用链。我已经修复了 ReActAgent,现在模型调用会先走 modelForCall(),当主模型失败时会切换到 fallback。同时我也补了回归测试,覆盖 fallback 切换和 builder 克隆场景。

    也就是说:
    在我修复前,fallbackModel 确实只是配进去了,没有真正接入运行时调用链,所以“主模型失败时 fallback 没触发”这个判断是对的。
    现在我这版已经修好了,agentscope-core\src\main\java\io\agentscope\core\ReActAgent.java 里已经走 modelForCall() 了

  5. amyaxy commented on Jun 26, 2026

    @amyaxy
    ContributorAuthor

    感谢提醒。你说得对,之前的版本里 fallbackModel 只是配置进去了,但没有真正接入运行时调用链。我已经修复了 ReActAgent,现在模型调用会先走 modelForCall(),当主模型失败时会切换到 fallback。同时我也补了回归测试,覆盖 fallback 切换和 builder 克隆场景。

    也就是说: 在我修复前,fallbackModel 确实只是配进去了,没有真正接入运行时调用链,所以“主模型失败时 fallback 没触发”这个判断是对的。 现在我这版已经修好了,agentscope-core\src\main\java\io\agentscope\core\ReActAgent.java 里已经走 modelForCall() 了

    PR合并的慢,已经冲突了

  6. moved this from In progress to Done in AgentScope Javaon Jul 6, 2026
  7. added a commit that references this issue on Jul 6, 2026
    aea6f0a
  8. added a commit that references this issue on Jul 6, 2026
    d395e39
  9. added a commit that references this issue on Aug 12, 2026
    7586b67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/core/agentbug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions