refactor(miles): drop unused router engine metadata#8
Open
TianyeGGBond wants to merge 1 commit into
Open
Conversation
dc33d2f to
1922974
Compare
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.
Context
This PR is intentionally separate from the health-check admission fix so reviewers can evaluate the dead-code cleanup independently.
plans/miles-port-unified-plan.md:4338originally describedmiles_engine_indexandmiles_worker_urlas the data source for_is_scheduler_preempt(output). That was the plan's original design:_is_scheduler_preemptwas expected to read those two fields from router-injected response metadata.The implementation later converged to a simpler contract. In
multi_turn.py,_is_scheduler_preempt(output)only readsmeta_info["miles_admission_disabled"]. It does not readmiles_engine_indexormiles_worker_url.That means the plan was over-designed for the final implementation. The reader side was simplified, but the router writer side was never cleaned up, leaving one-sided dead metadata fields.
A repo-wide search confirms this:
meta_info["miles_engine_index"]has no consumer.meta_info["miles_worker_url"]has no consumer.worker_engine_index_maponly exists to support the unusedmiles_engine_indexinjection path.multi_turnonly consumesmiles_admission_disabledfor redispatch classification.Keeping the unused parser/storage/injection path makes the router admission code look more coupled than it is, and it diverges from the upstream-style minimal router surface without functional benefit.
Change
worker_engine_index_mapfromMilesRouter.engine_indexfrom/add_workerquery/body payloads.meta_info["miles_engine_index"]into/generateresponses.meta_info["miles_worker_url"]into/generateresponses.worker_engine_index_mapfrom the dev-onlyadmission_stateendpoint.miles_admission_disabled.Validation
Passed syntax/whitespace checks:
Passed stale-reference checks:
Passed affected router admission tests using a temporary local Ray import stub, because this Windows environment does not have the real Ray package installed:
python -m pytest tests/test_partial_sleep_wake.py::TestRouterAdmissionLifecycle -q # 3 passed, 1 warning