Repository navigation
fix(core): wire fallback model into ReActAgent - #1851
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR fixes ReActAgent so that fallbackModel and maxRetries configurations actually take effect at runtime. The approach is correct: a modelForCall() decorator wraps the primary model with fallback logic, and buildGenerateOptions() injects maxRetries into ExecutionConfig. Two concerns: (1) the anonymous Model wrapper only overrides stream() and getModelName(), not supportsNativeStructuredOutput() or getContextWindowSize() - this violates the Decorator pattern contract; (2) summaryModelCallStream hook still references model.getModelName() (field) instead of mci.model().getModelName(), so fallback model name will not be reported correctly.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
f30432f to
6e0c382
Compare
AgentScope-Java Version
2.0.0-SNAPSHOT
Related Issue
Fixes #1850
Description
This PR wires
fallbackModelintoReActAgent's runtime model-call path. Before this change, fallback configuration was preserved in builder state but not actually used during execution, so the agent still failed when the primary model errored.Changes
maxRetries,fallbackModel) inBuilder.fromAgent(...).Validation
mvn -pl agentscope-core "-Dtest=ReActAgentTest,ReActAgentNewLoopBuilderTest,ReActAgentGenerateOptionsTest" test