[Bug]: The fallbackModel feature is not working.
AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.
Describe the bug
ReActAgent 当主模型不可用时,没有切换到备用模型
To Reproduce Steps to reproduce the behavior:
- You code
- How to execute
- 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.
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:
- Reproduce by configuring a fallbackModel with an invalid primary model
- Trace the exception flow in ReActAgent to find where the fallback is skipped
- Fix the wiring so the fallback model kicks in on primary model failure
Could you assign this to me? Please
感谢提醒。你说得对,之前的版本里 fallbackModel 只是配置进去了,但没有真正接入运行时调用链。我已经修复了 ReActAgent,现在模型调用会先走 modelForCall(),当主模型失败时会切换到 fallback。同时我也补了回归测试,覆盖 fallback 切换和 builder 克隆场景。
也就是说: 在我修复前,fallbackModel 确实只是配进去了,没有真正接入运行时调用链,所以“主模型失败时 fallback 没触发”这个判断是对的。 现在我这版已经修好了,agentscope-core\src\main\java\io\agentscope\core\ReActAgent.java 里已经走 modelForCall() 了
感谢提醒。你说得对,之前的版本里 fallbackModel 只是配置进去了,但没有真正接入运行时调用链。我已经修复了 ReActAgent,现在模型调用会先走 modelForCall(),当主模型失败时会切换到 fallback。同时我也补了回归测试,覆盖 fallback 切换和 builder 克隆场景。
也就是说: 在我修复前,fallbackModel 确实只是配进去了,没有真正接入运行时调用链,所以“主模型失败时 fallback 没触发”这个判断是对的。 现在我这版已经修好了,agentscope-core\src\main\java\io\agentscope\core\ReActAgent.java 里已经走 modelForCall() 了
PR合并的慢,已经冲突了