Repository navigation
fix(chat): guard user key against missing session scope - #6250
LearningCircuit merged 7 commits into
Conversation
|
Verified on The failure it closes is real for the callers the issue names: Checked:
One optional item: Decision: APPROVED — OPTIONAL CHANGES (the changelog fragment; nothing else to ask for) AI-assisted review. |
|
Added the requested optional changelog fragment ( The PR is now up to date. Thanks for the review! |
|
Fragment checked — On the checks: none have run on the last two heads, and that is not something on your side. This repository requires a maintainer to approve workflow runs from a first-time contributor's fork, so each push here waits for that click; the runs are queued as "action required". Once one of your PRs merges, subsequent pushes run automatically. Decision: APPROVED (the optional item is done; CI is awaiting maintainer approval to run) AI-assisted review. |
|
One thing blocks the merge now that the runs have been approved: the
The fix is one byte. From the repo root: (or Decision: CHANGES REQUESTED — add the trailing newline to AI-assisted review. |
Head branch was pushed to by a user without write access
|
Decision: APPROVED AI-assisted review. |
Summary
Fix
_chat_user_keyto safely handle requests where the ASGI scope does not contain asession, mirroring the existing_user_keyimplementation.Changes
"session"inrequest.scopebefore accessingrequest.session._get_client_ip(request)when the session scope is unavailable.Testing
pytest tests\chat\test_chat_route_helpers.py -q— 8 passedpytest tests\web\dependencies\test_rate_limit_keys.py -q— 41 passedruff check src\local_deep_research\web\routers\chat.py tests\chat\test_chat_route_helpers.py— passedgit diff --check— passedCloses #6239