Skip to content

Use the request-first TemplateResponse signature for the main UI page - #183

Open
mayuriphad wants to merge 1 commit into
devnen:mainfrom
mayuriphad:fix/template-response-signature
Open

mayuriphad wants to merge 1 commit into
devnen:mainfrom
mayuriphad:fix/template-response-signature

Conversation

@mayuriphad

Copy link
Copy Markdown

The main UI route calls templates.TemplateResponse("index.html", {"request": request}). That legacy signature was deprecated in Starlette 0.29 and removed in 1.0, so on an environment with a current Starlette (for example the unpinned requirements-strixhalo.txt, or a manually upgraded venv) / fails to render:

Error rendering main UI page: unhashable type: 'dict'
  File ".../starlette/templating.py", line 148, in TemplateResponse
    template = self.get_template(name)

and the user gets the "Internal Server Error" fallback page. The call is now templates.TemplateResponse(request, "index.html"), which Starlette (0.29+, including 1.x) accepts and which still injects request into the template context. The fastapi<0.116 pins in the other requirements files already resolve to a Starlette that supports it.

Fixes #179

Checked with Starlette 1.7.0: the old call raises TypeError: unhashable type: 'dict', the new call returns 200.

Signed-off-by: mayuriphad <mayuriphad656@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 04:50

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2026-09-26 09:07:34 [ERROR] server: Error rendering main UI page: unhashable type: 'dict' rtx 20060

2 participants