Repository navigation
Conversation
Align OmniBoxAdmissionMiddleware with vllm_common/admission.py so only non-HTTP/non-WebSocket scopes (such as lifespan) and HTTP GET/HEAD requests on ALWAYS_OPEN pass through unchecked, while all ASGI websocket scopes are closed immediately with code 1008 without reaching self.app. Pass allowed_target=config.is_target_allowed into Endpoint(...) in DiffusionWorkerService.__init__, matching vllm_common/worker_base.py, so action="create" patches and subsequent structural edits to created modules enforce VllmOmniConfig.allowed_targets. Add unit tests covering WebSocket rejection across open, drained, and isolated gate states (alongside lifespan and GET /health pass-through) and allowed_targets enforcement for created modules and follow-up edits. Agent-assisted-by: antigravity-cli / gemini-4-neon [effort=xhigh] (author) Signed-off-by: 李浩瑞 <haoruileee@gmail.com>
Add test_omni_startup_wiring_attaches_admission_middleware_to_empty_asgi_app to exercise NativeOmniServeLab._argv() and python -m inferrsi.box.repos.vllm_omni.bootstrap end-to-end against a zero-model, zero-device empty ASGI stub that dynamically imports the --middleware dotted path. Verify that NativeOmniServeLab rejects --middleware overrides, websocket upgrades close with code 1008 across open, drained, armed-window, and isolated gate states without reaching the inner ASGI app, and lifespan, GET /health, and normal POST /v1/videos/sync HTTP requests keep working. Agent-assisted-by: antigravity-cli / gemini-4-neon [effort=xhigh] (author) Signed-off-by: 李浩瑞 <haoruileee@gmail.com>
|
Antigravity (Gemini 4 Neon, xhigh), acting for @haoruilee. @jiangkuaixue123 Thanks for the review. In |
Governing Issue and delivery slice
Refs #1005
src/inferrsi/box/repos/vllm_omni/admission.py: narrows the unchecked pass-through guard inOmniBoxAdmissionMiddleware.__call__()toscope_type not in {"http", "websocket"}orscope_type == "http"GET/HEADrequests onALWAYS_OPEN(matchingvllm_common/admission.py:139-143), and closes all ASGI"websocket"scopes immediately with{"type": "websocket.close", "code": 1008}without invokingself.appor readingscope["method"].src/inferrsi/box/repos/vllm_omni/worker.py: passesallowed_target=config.is_target_allowedintoEndpoint(...)insideDiffusionWorkerService.__init__()(matchingvllm_common/worker_base.py:110), soaction="create"patches and subsequent structural edits (targets=()) to created modules enforceVllmOmniConfig.allowed_targets.tests/box/vllm_omni/test_omni_unit.py:test_omni_admission_middleware_closes_websockets_and_passes_lifespanverifying"websocket"scopes on/v1/realtimeand/health(without"method") receive{"type": "websocket.close", "code": 1008}and never invokeappacross open, drained (b"closed"), and isolated gate states, while"lifespan"and HTTPGET /healthpass through.test_omni_startup_wiring_attaches_admission_middleware_to_empty_asgi_appverifyingNativeOmniServeLabrejects--middlewareoverrides viaserve_args/engine_argsand exercisingNativeOmniServeLab._argv()+python -m inferrsi.box.repos.vllm_omni.bootstrap+ dynamic--middlewareimport on a zero-model, zero-device empty ASGI app (confirming"websocket"1008closure across open, drained, armed-window, and isolated states,"lifespan"andGET /healthpass-through, and normal HTTPPOST /v1/videos/syncand404non-pilot behavior).test_diffusion_worker_enforces_allowed_targets_on_created_modulesverifyingDiffusionWorkerService.prepare()rejectsaction="create"defining a disallowed function (code == "restart_required",phase == "rejected"), accepts and commitsaction="create"defining an allowed target, and rejects a follow-up structuralaction="edit"adding a disallowed function to that created module.vllm_common, Ascend NPU runtime evidence, or Issue closure.Knowledge authorship declaration
No path protected by
docs/knowledge-model-policy.mdis changed. The declaration is filled for completeness against the current head.Changed artifacts and evidence
"websocket"bypass of route allowlist, drain, and isolation, including real startup middleware wiringsrc/inferrsi/box/repos/vllm_omni/admission.py:49-56narrows pass-through to non-HTTP/non-WebSocket scopes and HTTPGET/HEADonALWAYS_OPEN, and closes"websocket"scopes withcode: 1008;tests/box/vllm_omni/test_omni_unit.pyadds direct middleware andNativeOmniServeLab._argv()+bootstrapstartup-wiring testsda5a01e7):app_reached: [('websocket', '/v1/realtime')]while drained and isolated (and startup-wiring test fails on revertedadmission.py); after (d8a7fe73):ws_messages: [{'type': 'websocket.close', 'code': 1008}],app_reached: []; both tests + 6 admission edge probes pass on Py3.10 & Py3.11d8a7fe73and live vLLM-Omni server verification pendingVllmOmniConfig.allowed_targetsonaction="create"and follow-up edits to created modulessrc/inferrsi/box/repos/vllm_omni/worker.py:111passesallowed_target=config.is_target_allowedtoEndpoint(...)da5a01e7): disallowedaction="create"authorized and committed (installed_fn_result: 42); after (d8a7fe73): rejected inprepare()withrestart_required/rejected(target is outside the enrolled target policy); covered bytest_diffusion_worker_enforces_allowed_targets_on_created_modules+ 5 worker edge probes on Py3.10 & Py3.11d8a7fe73and live Ascend NPU verification pendingChecks and dependencies
d8a7fe73bdfc1f57acc9b3b749667530119df8a7(underenv -u PYTHONPATH):ruff check src tests tools(Python 3.10.20 & 3.11.14): passed (All checks passed!).git diff origin/main..HEAD --check: passed.pytest -n 4 tests/box/vllm_omni/ tests/box/(Python 3.10.20 & 3.11.14):210 passedon both interpreters.tests/repository/test_architecture_anchors.py:4 passed.da5a01e7) vs after (d8a7fe73), mutant check reverting onlyadmission.pytoda5a01e7(caught bytest_omni_startup_wiring_attaches_admission_middleware_to_empty_asgi_app), plus 11/11 targeted edge probes passed on both Python 3.10.20 and Python 3.11.14.tools/check_pr_references.pyandtools/check_knowledge_model_policy.pyvalidation on this PR body andd8a7fe73bdfc1f57acc9b3b749667530119df8a7: passed.git 2.43.0 < 2.45), Windows/macOS advisoryhost-compatibility,installed-package,dashboard-browser, Ascend NPU hardware, live vLLM-Omni serving, and upstream GitHub Actions CI ond8a7fe73(pending; prior headd3b116f1passedfull-checkon Py3.10 & Py3.11 in run47071324270).origin/main59c1fb8543fcf5058a76437e5b558251f8aafc95. Zero file overlap with open PR feat(box): add Ascend 910B1 vLLM-Omni T2VA pilot runner and offline receipt auditor #972 (which modifies onlyevidence/,tests/box/repos/,tests/repository/, andtools/evidence_inventory.json).Remaining work and Issue closure
d8a7fe73, and independent review.