mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
Follow-up to the reply-language feature. `_model_or_none` was private to LlmBuilderAgent, so the advance-task wiring reached it via a fragile `getattr(agent, "_model_or_none", lambda: None)`. Make it part of the DifyBuilderAgent protocol (typed `object | None` to keep the pure port free of any model-runtime import) and implement it on every conforming agent (LlmBuilderAgent renames the private method public; PlaceholderAgent and the test doubles return None). The Localizer wiring now uses `agent.model_or_none` directly. Also drops the useless-return ruff nit in the wiring test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>