-
Notifications
You must be signed in to change notification settings - Fork 540
fix: stop marking newly created apps as draft in playground #4569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GanJiaKouN16
wants to merge
9
commits into
Agenta-AI:main
Choose a base branch
from
GanJiaKouN16:fix/playground-draft-tag-4556
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6eaecdd
feat: add reset password functionality to workspace UI
GanJiaKouN16 445fc3f
fix: add shouldIgnoreRowClick guard to unprotected tables
GanJiaKouN16 585c6ad
fix: surface provider error messages in evaluation table
GanJiaKouN16 c9d112d
fix: use explicit env var mapping for Together AI provider in vault m…
GanJiaKouN16 01a6e6d
fix: link evaluator button to playground instead of registry in trace…
GanJiaKouN16 1706e43
feat: migrate email from SendGrid to SMTP with SendGrid fallback
GanJiaKouN16 ad6e140
fix: show correct breadcrumb label for SDK evaluations
GanJiaKouN16 cd01041
test: add e2e tests for annotation queue flows
GanJiaKouN16 77f3ec1
fix: stop marking newly created apps as draft in playground
GanJiaKouN16 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -922,12 +922,40 @@ def enabled(self) -> bool: | |
|
|
||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # sendgrid | ||
| # smtp | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| class SmtpConfig(BaseModel): | ||
| """SMTP Email configuration""" | ||
|
|
||
| host: str | None = os.getenv("SMTP_HOST") | ||
| port: int = int(os.getenv("SMTP_PORT", "587")) | ||
| username: str | None = os.getenv("SMTP_USERNAME") | ||
| password: str | None = os.getenv("SMTP_PASSWORD") | ||
| from_address: str | None = ( | ||
| os.getenv("SMTP_FROM_ADDRESS") | ||
| or os.getenv("SENDGRID_FROM_ADDRESS") | ||
| or os.getenv("AGENTA_AUTHN_EMAIL_FROM") | ||
| or os.getenv("AGENTA_SEND_EMAIL_FROM_ADDRESS") | ||
| ) | ||
| use_tls: bool = os.getenv("SMTP_USE_TLS", "true").lower() in ("true", "1", "yes") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the shared truthy parser for
Proposed fix- use_tls: bool = os.getenv("SMTP_USE_TLS", "true").lower() in ("true", "1", "yes")
+ use_tls: bool = (os.getenv("SMTP_USE_TLS") or "true").lower() in _TRUTHY |
||
|
|
||
| model_config = ConfigDict(extra="ignore") | ||
|
|
||
| @property | ||
| def enabled(self) -> bool: | ||
| """SMTP enabled if host and from address are present""" | ||
| return bool(self.host and self.from_address) | ||
|
|
||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # sendgrid (legacy — kept for backwards compatibility) | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| class SendgridConfig(BaseModel): | ||
| """SendGrid Email configuration""" | ||
| """SendGrid Email configuration (legacy)""" | ||
|
|
||
| api_key: str | None = os.getenv("SENDGRID_API_KEY") | ||
| from_address: str | None = ( | ||
|
|
@@ -1037,15 +1065,9 @@ def email_method(self) -> str: | |
| if env.agenta.access.email_disabled: | ||
| return "" | ||
|
|
||
| sendgrid_enabled = bool( | ||
| os.getenv("SENDGRID_API_KEY") | ||
| and ( | ||
| os.getenv("SENDGRID_FROM_ADDRESS") | ||
| or os.getenv("AGENTA_AUTHN_EMAIL_FROM") | ||
| or os.getenv("AGENTA_SEND_EMAIL_FROM_ADDRESS") | ||
| ) | ||
| ) | ||
| return "otp" if sendgrid_enabled else "password" | ||
| # SMTP takes priority, then SendGrid fallback | ||
| email_configured = env.smtp.enabled or env.sendgrid.enabled | ||
| return "otp" if email_configured else "password" | ||
|
|
||
| @property | ||
| def email_enabled(self) -> bool: | ||
|
|
@@ -1101,6 +1123,7 @@ class EnvironSettings(BaseModel): | |
| posthog: PostHogConfig = PostHogConfig() | ||
| redis: RedisConfig = RedisConfig() | ||
| sendgrid: SendgridConfig = SendgridConfig() | ||
| smtp: SmtpConfig = SmtpConfig() | ||
| stripe: StripeConfig = StripeConfig() | ||
| supertokens: SuperTokensConfig = SuperTokensConfig() | ||
|
|
||
|
|
||
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offload blocking backend sends from the async request path.
send_emailisasync, but both backend calls here are synchronous network I/O. A slow SMTP/SendGrid call can block the event loop and hurt API responsiveness.Proposed fix
📝 Committable suggestion