fix: surface silent routing fallbacks with warning logs - #194
Open
connectsudhindra-gif wants to merge 1 commit into
Open
fix: surface silent routing fallbacks with warning logs#194connectsudhindra-gif wants to merge 1 commit into
connectsudhindra-gif wants to merge 1 commit into
Conversation
OpenClawRouter silently fell back to a random/default model whenever the ML-based router failed to load, returned no usable model name, or raised an exception - with zero indication in the logs that routing had actually failed. This made misconfigurations and routing bugs invisible to operators, who would only notice via degraded response quality. Each fallback path now logs a clear warning explaining why the fallback was triggered, matching the existing warning style used elsewhere in this module.
Author
|
@Kunlun-Zhu / @bobjiang82 / @JiaxuanYou Pls review and let me know any adjustment needed |
Author
|
@Kunlun-Zhu / @bobjiang82 / @JiaxuanYou Pls review and let me know any adjustment needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #153.
OpenClawRouter(the server backingllmrouter serve) silently fell back to a random/default model whenever:route_singlereturned no recognizable model name, orroute_singleraised an exception,with zero log output indicating that routing had actually failed. Operators had no way to notice a misconfiguration or routing bug short of observing degraded response quality.
Changes
openclaw_router/routers.py: each fallback path inLLMRouterAdapter.route()andselect_by_llm()now logs a clear warning explaining what failed and why the fallback was triggered, matching the existing warning style already used elsewhere in this module.Test plan
python -m py_compile openclaw_router/routers.py