feat(router): [cherry-pick 1.5.0] ship two-tier worker-selection policy (#14498) - #14901
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| .expect("a configured instance resolves to a factory"); | ||
|
|
||
| let partition = RoutingPartitionRef::new("model", "default"); | ||
| for worker_type in [ |
There was a problem hiding this comment.
The per-role factory calls duplicate existing registry/config coverage: selected_worker_selection_policy_instances_apply_stage_precedence already verifies YAML stage selection, and resolved_factory_dispatches_role_specific_instances already verifies role dispatch. This built-in provider does not vary behavior by worker type, so one factory construction after resolving the documented YAML preserves the supported contract that the policy type and instance shape are linked and constructible.
🤖 AI Fix
Replace the loop with a single factory invocation for one worker type after the YAML resolution assertion.
Summary
Cherry-pick #14498 (
e03db5f6ea37919fdd9250eedb9e3bcddb7653b3) intorelease/1.5.0. Ships the two-tier worker-selection policy, enablescustom-policyby default, and includes the original CI and documentation updates.Resolved Cargo conflicts against the release branch and regenerated the bindings lockfile. The only code adaptation is using the release branch's
router_hint_candidatesandretain_router_hint_chainfield names in the test fixture; production policy logic is unchanged.Validation
cargo test --locked -p dynamo-custom-policy-builtin: 7 passed.cargo clippy --locked -- -D warnings, with default features and with--no-default-features: both passed.