UN-2888 [FIX] Add hook for setting default triad for invited users#1877
Conversation
Add setup_default_adapters_for_user() hook to AuthenticationService and call it from set_user_organization() when an invited user joins an existing organization. This allows the cloud plugin to set up default triad adapters (LLM, embedding, vector DB, x2text) for invited users, fixing silent failures in API deployment creation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughController now calls Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| backend/account_v2/authentication_controller.py | Adds setup_default_adapters_for_user hook call in the else (non-new org / invited user) branch of set_user_organization, with proper MethodNotImplemented catch and info-level logging consistent with frictionless_onboarding. |
| backend/account_v2/authentication_service.py | Adds base setup_default_adapters_for_user stub that raises MethodNotImplemented, following the same plugin pattern as frictionless_onboarding. |
| frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx | Renames 'Default Triad' menu label to 'Default LLM Profile' — cosmetic label change only. |
| frontend/src/components/settings/default-triad/DefaultTriad.jsx | Renames page heading to 'Default LLM Profile' but leaves two user-facing error messages referencing the old 'Default Triads' label, creating a minor UI inconsistency. |
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
frontend/src/components/settings/default-triad/DefaultTriad.jsx:102
The two user-visible error toast messages still reference "Default Triads" while the heading was renamed to "Default LLM Profile". When either fetch or update fails, users will see an alert that mentions a term that no longer matches anything on screen.
```suggestion
setAlertDetails(handleException(err, "Failed to fetch Default LLM Profile"));
```
### Issue 2 of 2
frontend/src/components/settings/default-triad/DefaultTriad.jsx:168
Matching update-side error message also references the old "Default Triads" label, creating the same inconsistency when a save fails.
```suggestion
handleException(err, "Failed to update Default LLM Profile"),
```
Reviews (7): Last reviewed commit: "Merge branch 'main' into fix/set-default..." | Re-trigger Greptile
There was a problem hiding this comment.
🧹 Nitpick comments (1)
backend/account_v2/authentication_controller.py (1)
216-222: Consider adding a log message for consistency withfrictionless_onboarding.The
frictionless_onboardingexception handler at line 208 logs"frictionless_onboarding not implemented", but this handler silently passes. Adding a similar log message would improve debugging consistency for OSS deployments.♻️ Suggested change
else: try: self.auth_service.setup_default_adapters_for_user( organization=organization, user=user ) except MethodNotImplemented: - pass + logger.info("setup_default_adapters_for_user not implemented")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@backend/account_v2/authentication_controller.py` around lines 216 - 222, The except block swallowing MethodNotImplemented for self.auth_service.setup_default_adapters_for_user should log a message like the frictionless_onboarding handler does; update the except MethodNotImplemented block in authentication_controller (around setup_default_adapters_for_user) to call the same logger used for frictionless_onboarding and emit a clear message such as "setup_default_adapters_for_user not implemented" and include minimal context (organization id/name and user id/email) to aid debugging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@backend/account_v2/authentication_controller.py`:
- Around line 216-222: The except block swallowing MethodNotImplemented for
self.auth_service.setup_default_adapters_for_user should log a message like the
frictionless_onboarding handler does; update the except MethodNotImplemented
block in authentication_controller (around setup_default_adapters_for_user) to
call the same logger used for frictionless_onboarding and emit a clear message
such as "setup_default_adapters_for_user not implemented" and include minimal
context (organization id/name and user id/email) to aid debugging.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 708b08ff-27b6-4bb5-b5a2-12840cd88c63
📒 Files selected for processing (2)
backend/account_v2/authentication_controller.pybackend/account_v2/authentication_service.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Praveen Kumar <praveen@zipstack.com>
Address review comment: log user email and explain that default adapters will not be set when the method is not implemented. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update display label from "Default Triad" to "Default LLM Profile" in the page heading and side navigation menu. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Frontend Lint Report (Biome)✅ All checks passed! No linting or formatting issues found. |
Test ResultsSummary
Runner Tests - Full Report
SDK1 Tests - Full Report
|
|
…1877) * [FIX] Add hook for setting default adapters for invited users Add setup_default_adapters_for_user() hook to AuthenticationService and call it from set_user_organization() when an invited user joins an existing organization. This allows the cloud plugin to set up default triad adapters (LLM, embedding, vector DB, x2text) for invited users, fixing silent failures in API deployment creation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update backend/account_v2/authentication_controller.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Praveen Kumar <praveen@zipstack.com> * [FIX] Improve log message for setup_default_adapters_for_user Address review comment: log user email and explain that default adapters will not be set when the method is not implemented. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [MISC] Rename Default Triad to Default LLM Profile in UI Update display label from "Default Triad" to "Default LLM Profile" in the page heading and side navigation menu. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Signed-off-by: Praveen Kumar <praveen@zipstack.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>



What
setup_default_adapters_for_user()hook method toAuthenticationService(raisesMethodNotImplemented)set_user_organization()inAuthenticationControllerfor non-new organizations (invited user flow)Why
UserDefaultAdapterrecord is missingHow
setup_default_adapters_for_user()to the baseAuthenticationServicefollowing the same plugin pattern asfrictionless_onboarding()(raisesMethodNotImplementedin base, implemented in cloud)set_user_organization(), aftercreate_tenant_user(), the hook is called in theelsebranch (non-new org) with a try/except forMethodNotImplementedUserDefaultAdapterfor the invited userCan this PR break any existing features? If yes, please list possible items. If no, please explain why.
MethodNotImplementedin the base implementation, which is caught and silently ignored. This is the same pattern used byfrictionless_onboarding(). OSS deployments are unaffected.Database Migrations
Env Config
Related Issues or PRs
fix/set-default-triad-for-invited-userDependencies Versions
Notes on Testing
pluggable_apps/platform_admin/tests/test_set_default_adapters.pycovering:Checklist
🤖 Generated with Claude Code