Skip to content

fix(server): pass HTTP request context to compliance controllers on next - #1955

Merged
bokelley merged 2 commits into
nextfrom
claude/issue-1821-controller-request-context-next
Nov 27, 2026
Merged

bokelley merged 2 commits into
nextfrom
claude/issue-1821-controller-request-context-next

Conversation

@bokelley

@bokelley bokelley commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Forward-ports #1830 (open against main) to next, so 10.0 carries the #1821 fix too. register_test_controller built the RequestMetadata for comply_test_controller without request_context. A context_factory that resolves tenants or principals from the HTTP request therefore saw None on the controller path only. The fix passes _get_starlette_request_for_dispatch(), as every other tool path does.

  • The commit is cherry-picked unchanged from dc16c6c1f (git cherry-pick -x), authorship kept. It applied cleanly to next @ 30e81501f.
  • tests/test_test_controller_context.py comes with it: 19 passed locally, run on its own.
  • fix(server): pass HTTP request context to compliance controllers #1830 should still merge to main for 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

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: true only because src/adcp/server/test_controller.py (modified) matches src/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 approve is 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.

@bokelley
bokelley merged commit 24b8c4d into next Nov 27, 2026
41 checks passed
@bokelley
bokelley deleted the claude/issue-1821-controller-request-context-next branch November 27, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants