feat(openai-router): use per-model retry config from WorkerRegistry - #935
Conversation
OpenAI router now resolves per-model retry config from WorkerRegistry before passing it to ChatRouterContext, falling back to the router-level default if no worker group override exists. Signed-off-by: Chang Su <chang.s.su@oracle.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe OpenAI router's chat routing method now resolves per-model retry configuration from the worker registry, with fallback to the router-level default configuration if unavailable. The chat routing context is updated to receive this selected configuration instead of the router's global retry config. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request implements per-model retry configurations in the OpenAI router, allowing for model-specific retry logic with a default fallback. A review comment suggests refactoring the configuration retrieval to return references to avoid unnecessary clones and improve efficiency.
…mg-project#935) Signed-off-by: Chang Su <chang.s.su@oracle.com>
Description
Part of the per-worker resilience refactor series: #799 → #803 → #821 → #836 → #875 → #881 / #933 → this PR.
Problem
OpenAI router uses a single global
retry_configfor all requests, ignoring per-model retry config set by workers.Solution
Resolve per-model retry config from
WorkerRegistryinroute_chat()before passing it toChatRouterContext, falling back to the router-level default.Independent of #881 (HTTP router) and #933 (gRPC router).
Changes
route_chat()in OpenAI router resolves retry config fromWorkerRegistryper model IDTest Plan
cargo test -p smg --lib— all 450 tests passChecklist
cargo +nightly fmtpassescargo clippy --all-targets --all-features -- -D warningspassesSummary by CodeRabbit
Summary by CodeRabbit