Skip to content

fix: surface silent routing fallbacks with warning logs - #194

Open
connectsudhindra-gif wants to merge 1 commit into
ulab-uiuc:mainfrom
connectsudhindra-gif:fix/silent-routing-fallback
Open

fix: surface silent routing fallbacks with warning logs#194
connectsudhindra-gif wants to merge 1 commit into
ulab-uiuc:mainfrom
connectsudhindra-gif:fix/silent-routing-fallback

Conversation

@connectsudhindra-gif

Copy link
Copy Markdown

Summary

Fixes #153. OpenClawRouter (the server backing llmrouter serve) silently fell back to a random/default model whenever:

  • the configured ML-based router failed to load,
  • route_single returned no recognizable model name, or
  • route_single raised 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 in LLMRouterAdapter.route() and select_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.
  • No behavior change: the same random/default fallback still occurs, it is just no longer silent.

Test plan

  • python -m py_compile openclaw_router/routers.py
  • Manually exercised each fallback path (router not loaded, no match, exception) and confirmed a warning is logged with the correct reason.

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.
@connectsudhindra-gif

Copy link
Copy Markdown
Author

@Kunlun-Zhu / @bobjiang82 / @JiaxuanYou Pls review and let me know any adjustment needed

@connectsudhindra-gif

Copy link
Copy Markdown
Author

@Kunlun-Zhu / @bobjiang82 / @JiaxuanYou Pls review and let me know any adjustment needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Router fails silently when no suitable model found

1 participant