[claude] Fix Starlette 1.0.0 TemplateResponse API in calm and tools routes (#1112) #1115
Reference in New Issue
Block a user
Delete Branch "claude/issue-1112"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1112
Root Cause
Starlette 1.0.0 changed the
TemplateResponsesignature from(name, context_dict)to(request, name, context_dict). Several routes incalm.pyandtools.pystill used the old-style call.With the old call, the context dict was passed as
name. Jinja2 then tried to use it as part of a cache key (wrapped in a tuple), causingTypeError: cannot use 'tuple' as a dict key (unhashable type: 'dict')in Python 3.14.Fix
Updated all affected
TemplateResponsecalls incalm.py(6 endpoints) andtools.py(1 endpoint) to use the new(request, name, context)signature, removing"request"from the context dict.Result
tox -e unitnow passes with 3242 passed, 0 failed.