Repository navigation
fix(server): pass HTTP request context to compliance controllers on next - #1955
Conversation
(cherry picked from commit dc16c6c)
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Clean git cherry-pick -x of merged #1830 onto next. comply_test_controller now passes request_context=_get_starlette_request_for_dispatch() into RequestMetadata, matching the three existing call sites in serve.py (L3402/3427/3445). The change is additive (field already None-defaulted), with no wire-shape or public-API change, and carries the correct fix(server): prefix. A parametrized test (stateless/stateful × request_state/builtin factory) asserts the context now arrives non-None on the controller path.
No blocking findings. The high_risk flag is set only because src/adcp/server/test_controller.py is a modified file under src/adcp/server/**; the reviewer found no medium-or-higher concerns, so the modification is presumed safe (does not escalate on the flag alone). No gated paths, no no-auto-approve team match, first review. Falls through to row 9.
… name On next, advertised_tools registers the handler class name globally, and tests/test_wba_task_ownership.py registers another class named Handler with a different tool set, so whichever ran second in an xdist worker failed at setup. Refs #1821 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — test-only change threading HTTP request context into the test controller, with a clean test-class rename to avoid xdist collisions.
What I checked:
- No critical/high/medium findings from the reviewer.
gated_paths: false;review_decision: APPROVED— no hard path gate in play.- No no-auto-approve team match.
high_risk: trueonly becausesrc/adcp/server/test_controller.py (modified)matchessrc/adcp/server/**. Per the risk model, a modified high-risk file with no medium-or-higher finding is presumed safe — not an escalation trigger on the flag alone.- Delta since the prior
approveis a single test-class rename (Handler → ControllerRequestContextHandler) plus threading_get_starlette_request_for_dispatch()into RequestMetadata; the helper fail-opens to None outside dispatch, consistent with existing non-HTTP tests.
Rows 1–8 do not fire (no blocking findings, no gate, no deletion, no medium findings, no sticky escalation — prior decision was approve). Falls through to row 9: approve.
Summary
Forward-ports #1830 (open against
main) tonext, so 10.0 carries the #1821 fix too.register_test_controllerbuilt theRequestMetadataforcomply_test_controllerwithoutrequest_context. Acontext_factorythat resolves tenants or principals from the HTTP request therefore sawNoneon the controller path only. The fix passes_get_starlette_request_for_dispatch(), as every other tool path does.dc16c6c1f(git cherry-pick -x), authorship kept. It applied cleanly tonext@30e81501f.tests/test_test_controller_context.pycomes with it: 19 passed locally, run on its own.mainfor 9.x. This PR covers only the 10.x line.Closes #1821 on the 10.x line; #1830 closes it for
main.🤖 Generated with Claude Code