refactor: inject current user id in stop message endpoints#36925
Merged
asukaminato0721 merged 7 commits intoJun 2, 2026
Conversation
Contributor
Pyrefly Type Coverage
|
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors console stop-message endpoints to inject the authenticated user’s ID via @with_current_user_id, avoiding direct dependency on current_user where only the ID is needed.
Changes:
- Added
@with_current_user_idto stop endpoints and updated handler signatures to acceptcurrent_user_id: str. - Replaced
user_id=current_user.idwithuser_id=current_user_idin stop-task calls. - Removed
current_usertype assertions in the explore stop endpoints (and one of the debugger stop endpoints).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| api/controllers/console/explore/completion.py | Uses @with_current_user_id for installed-app stop endpoints and passes current_user_id into AppTaskService.stop_task. |
| api/controllers/console/app/completion.py | Applies @with_current_user_id to debugger stop endpoints and switches stop-task calls to use the injected user id. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
asukaminato0721
previously approved these changes
Jun 2, 2026
Contributor
|
fix test, you can check how other pr do. change the signature. |
auto-merge was automatically disabled
June 2, 2026 05:08
Head branch was pushed to by a user without write access
Contributor
Author
Updated the stop endpoint tests to pass current_user_id explicitly after unwrapping the decorated handlers. |
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
asukaminato0721
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Fixes #<issue number>.Summary
Refactor console stop-message endpoints to inject the current account id with
with_current_user_id.This PR replaces direct
current_user.idusage in stop-message endpoints where only the user id is needed. Handlers that still require the fullAccountobject are kept unchanged.Fixes #36585
Screenshots
Not applicable. This is a backend refactor and does not change the UI.
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint godsTest
Not run locally.
uv sync --devfails on Windows becauseclickzetta-connector-python==0.8.104cannot be resolved throughdify-vdb-clickzetta.