Skip to content

refactor: inject tenant id in tenant-only console handlers#36751

Merged
asukaminato0721 merged 1 commit into
langgenius:mainfrom
Tianlel:chore/tenant-id-only-dep-inject
May 28, 2026
Merged

refactor: inject tenant id in tenant-only console handlers#36751
asukaminato0721 merged 1 commit into
langgenius:mainfrom
Tianlel:chore/tenant-id-only-dep-inject

Conversation

@Tianlel
Copy link
Copy Markdown
Contributor

@Tianlel Tianlel commented May 28, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Part of #36585.

This PR applies the existing with_current_tenant_id decorator to console handlers in tenant-id-only controller files.

It updates these files:

  • api/controllers/console/app/generator.py
  • api/controllers/console/app/mcp_server.py
  • api/controllers/console/workspace/models.py

These handlers now receive current_tenant_id or tenant_id directly instead of unpacking current_account_with_tenant() and discarding the account.

Test updates are included for generator, MCP server, and workspace model handlers.

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 45.79% 45.81% +0.02%
Strict coverage 45.31% 45.33% +0.02%
Typed symbols 24,531 24,552 +21
Untyped symbols 29,352 29,352 0
Modules 2740 2740 0

@Tianlel Tianlel changed the title chore: inject tenant id in tenant-only handlers refactor: inject tenant id in tenant-only console handlers May 28, 2026
@Tianlel Tianlel marked this pull request as ready for review May 28, 2026 03:40
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. refactor labels May 28, 2026
@asukaminato0721 asukaminato0721 enabled auto-merge May 28, 2026 03:44
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 28, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue May 28, 2026
Merged via the queue into langgenius:main with commit 0e1f19a May 28, 2026
31 checks passed
@Tianlel Tianlel deleted the chore/tenant-id-only-dep-inject branch May 28, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants