fix(steering): port declarative override parity (compose+precedence) to v2 runner - #224
Merged
RhizoNymph merged 1 commit intoJul 3, 2026
Conversation
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.
What & why
_apply_request_overrideon the v2 GPU runner (vllm/v1/worker/gpu/steering_runner_mixin.py) had silently dropped three behaviors that v1's implementation (vllm/v1/worker/steering_model_runner_mixin.py) has, even though declarative per-request gates (PR #219) are live on v2 — the default runner for Qwen3/Llama. This is a real user-facing correctness bug.The gap on v2:
compose_admittedignored. A declarativeaddgate emitsRequestSteeringOverride(compose_admitted=True), meant to add on top of the request's admitted static decode steering. v2 registeredaction.vectorsraw, so on v2 anaddgate replaced the client's static decode steering instead of composing. Fixed by folding the admitted decode spec (_resolve_request_steering(sp, "decode"), admitted params sourced from v2's_steering_reqs) with the gate delta viamerge_steering_specs, mirroring v1.Operator-wins precedence never enforced. v2 never ran the precedence check and never wrote
_req_override_source, so the inherited_apply_scale_update/_apply_monitor_updateprecedence checks (which read_req_override_source) were vacuous on v2 — a client declarative gate could scale/monitor/override a request already owned by an operator consumer. Fixed by adding the samesource == DECLARATIVE_SOURCE and owner != sourcerejection and stamping_req_override_sourceon every apply.Clear path leaked the source map. The
vectors is Noneclear didn't pop_req_override_source. Fixed; request finish/preempt cleanup already routes through the inherited_drop_request_dynamic_override, which purges both maps.The v2 docstring's "Identical routing semantics to v1" claim is now accurate.
Also hardened (v1 + v2): the
compose_admittedfold calls_resolve_request_steering(..., "decode"), which can raiseRuntimeErrorwhen a request's steering module is not registered on the worker. That exception escaped_apply_request_override's except clauses and would crash the engine, defeating observer isolation. Both runners now catch it and return a structured rejection, keeping prior state.Files
vllm/v1/worker/gpu/steering_runner_mixin.py— v2 parity port (precedence check,_req_override_sourcebookkeeping,compose_admittedfold, guarded resolve, clear-path source pop).vllm/v1/worker/steering_model_runner_mixin.py— guard the v1 compose fold's_resolve_request_steeringagainstRuntimeError.tests/v1/worker/test_gpu_v2_steering_glue.py— 8 new v2 tests mirroring v1 coverage (compose fold, no-compose raw, declarative-yields-to-operator + operator-takes-over, clear/finish purge_req_override_source, inherited scale + monitor precedence now effective on v2).docs/design/dynamic_steering.md§8.2 — precedence paragraph now notes both runners are kept in lock-step and mentions the guarded fold.Notes
Sibling PR
fix/declarative-gate-fail-closedmay touchsteering_model_runner_mixin.py's action-apply path concurrently; expect a possible merge conflict there.