Skip to content

Keep the live Context when a prompt or template annotates Context[T] - #3624

Merged
maxisbey merged 1 commit into
mainfrom
3235-parameterized-context
Oct 2, 2026
Merged

maxisbey merged 1 commit into
mainfrom
3235-parameterized-context

Keep the live Context when a prompt or template annotates Context[T]

7819a62
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Oct 2, 2026 in 15m 3s

Code review found 4 potential issues

Found 9 candidates, confirmed 4. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 3
🟣 Pre-existing 1
Severity File:Line Issue
🟡 Nit src/mcp/server/mcpserver/context.py:92 Servers whose prompt or template parameter is annotated with their own 'Context' subclass now get a plain 'Context' hand
🟡 Nit tests/server/mcpserver/test_server.py:3190 nit: the new 'test_context_request_context_outside_request_raises' pins the 'ValueError' by 'match="outside of a request
🟡 Nit tests/server/mcpserver/test_server.py:1343 nit: AGENTS.md requires type hints for all code: the two new async test functions 'test_parameterized_context_carries_th
🟣 Pre-existing docs/handlers/lifespan.md:44 Readers following docs/handlers/lifespan.md:44 and adding 'ctx' to a static '@ mcp.resource("config://app")' get a 'Valu