fix: show correct breadcrumb label for SDK evaluations#4567
fix: show correct breadcrumb label for SDK evaluations#4567GanJiaKouN16 wants to merge 7 commits into
Conversation
Wire the existing GenerateResetLinkModal and PasswordResetLinkModal into the Actions dropdown in the workspace members table. - Add 'Reset password' menu item for workspace members (not self) - Add resetPassword API function in profile service - Show confirmation dialog before generating the reset link - Display the generated password reset link with copy functionality Closes Agenta-AI#2572
Several tables with row-level click navigation were missing the shouldIgnoreRowClick guard, causing clicks on interactive elements (checkboxes, dropdowns, buttons) to accidentally trigger row navigation. Changes: - Consolidate shouldIgnoreRowClick with broader selector list (merges EvaluationRunsTablePOC's extra selectors: [role='button'], [role='menuitem'], [role='checkbox'], .ant-btn, etc.) - Export INTERACTIVE_ROW_SELECTORS constant for reuse - Add guard to ObservabilityTable (traces) - Add guard to SessionsTable - Add guard to PromptsPage - Add guard to TestcasesTableShell - Add guard to EntityTable - Replace partial data-ivt-stop-row-click check in ScenarioListView with full shouldIgnoreRowClick - Update useEntityTableState to use consolidated selectors - Remove duplicate shouldIgnoreRowClick from navigationActions.ts - Update EvaluationRunsTablePOC to import from shared utility Closes Agenta-AI#3254
The evaluation table was showing a generic 'too many requests' message instead of the actual provider error because: 1. executeViaFetch never checked for body-level errors on HTTP 200. The Python SDK can return HTTP 200 with a non-200 status.code embedded in the response body (WorkflowBatchResponse.status.code). This path was silently treated as success. 2. Error stacktrace/type/code were not propagated through the pipeline. Even when the HTTP error path was taken, only the message was extracted — the SDK's status.type, status.code, and status.stacktrace were dropped. Changes: - executeViaFetch: detect body-level errors on HTTP 200 by checking responseData.status.code !== 200 and return an error result - executeViaFetch: extract stacktrace (coercing string[] to string), type, and code from both HTTP-error and body-error paths - Add stacktrace and type to ExecutionResult, RunResult, and ExecuteWorkflowRevisionResult error shapes - runInvocationAction: pass stacktrace and type through to upsertStepResultWithInvocation - upsertStepResultWithInvocation: accept type field in error param No UI changes needed — InvocationCell already renders stepError.message and stepError.stacktrace when present; extractStepError already reads error.code, error.type, error.stacktrace from persisted step data. Closes Agenta-AI#3324
…iddleware
The vault middleware built env var names using f'{provider.upper()}_API_KEY'
which produces TOGETHER_AI_API_KEY for the 'together_ai' provider kind.
The actual env var is TOGETHERAI_API_KEY (no underscore), matching the
frontend (llmProviders.ts, transforms.ts), backend (env.py), and the
Daytona sandbox runner (daytona.py).
Add an explicit _PROVIDER_ENV_VAR_MAP dict (mirroring the Daytona runner
pattern) that maps each provider kind to its correct env var name, with
fallback to the original f-string pattern for any future providers.
Closes Agenta-AI#3659
… drawer The 'Open evaluator registry' button in the Trace Drawer's EvaluatorDetailsPopover navigated human evaluators to the registry page (/evaluators?tab=human&openEvaluator=...) instead of the evaluator playground. Automatic evaluators already linked correctly. Unify both evaluator types to navigate to the playground (/evaluators/playground?revisions=...), consistent with how other parts of the codebase link to evaluators (EvaluatorSection, ConfigurationView). Update button text to 'Open evaluator playground'. Closes Agenta-AI#4535
Replace the SendGrid-only email backend with SMTP support, keeping SendGrid as a legacy fallback for existing deployments. Changes: - email_service.py: use smtplib for SMTP (priority), SendGrid as fallback, no-op when neither is configured - env.py: add SmtpConfig (SMTP_HOST, SMTP_PORT, SMTP_USERNAME, SMTP_PASSWORD, SMTP_FROM_ADDRESS, SMTP_USE_TLS), keep SendgridConfig for backwards compatibility; update AuthFacade.email_method to check both - OSS/EE organization_service.py: use env.smtp.enabled || env.sendgrid .enabled; use configured from_address instead of hardcoded email - user_service.py: same email-enabled check update - db_manager_ee.py: remove dead sendgrid import and unused sg client - pyproject.toml: remove sendgrid dependency (imported lazily only when SENDGRID_API_KEY is set) - env example files: add SMTP vars, mark SendGrid as legacy - docs: add SMTP config table, mark SendGrid as legacy Closes Agenta-AI#4536
The breadcrumb always showed 'Auto Evals' for SDK evaluations because: 1. test.tsx normalized type='custom' to 'auto' before passing to EvalRunPreviewPage, losing the SDK type information 2. Page.tsx typeMap had no 'custom' entry 3. buildBreadcrumbs.ts hardcoded 'auto evaluation' as fallback label Fix: - Remove the custom→auto normalization in test.tsx - Add 'custom' → 'SDK Evals' entry to Page.tsx typeMap (matches the tab label in EvaluationsView.tsx) - Change buildBreadcrumbs.ts fallback from 'auto evaluation' to 'Evaluations' Closes Agenta-AI#4549
|
Someone is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (37)
💤 Files with no reviewable changes (3)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (28)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR adds SMTP email support with SendGrid fallback, consolidates interactive-element click handling across tables, extends evaluation type support for custom SDK evals with richer error reporting, unifies evaluator navigation routes, introduces workspace member password reset, and improves SDK provider environment variable mapping. ChangesEmail System: SMTP Support with SendGrid Legacy Fallback
Evaluation Runs: Custom SDK Eval Type and Richer Error Details
Interactive Row Click Handling: Centralization and Expansion
Workspace Member Password Reset Feature
SDK Provider Environment Variable Mapping
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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 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 |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
web/oss/src/components/EvalRunDetails/components/Page.tsx (1)
26-30:⚠️ Potential issue | 🔴 CriticalFix
evaluationTypeprop union to include"custom"inEvalRunPreviewPageProps.
Page.tsxtypesevaluationTypeas"auto" | "human" | "online"(excludes"custom"), but the caller/test definesEvalRunKindwith"custom"and passes it viaevaluationType={evaluationType}, sotype="custom"will fail TS type-checking.Suggested fix
interface EvalRunPreviewPageProps { runId: string - evaluationType: "auto" | "human" | "online" + evaluationType: "auto" | "human" | "online" | "custom" projectId?: string | null }
🧹 Nitpick comments (3)
sdks/python/agenta/sdk/middlewares/running/vault.py (1)
40-60: ⚡ Quick winConsider extracting the provider mapping to a shared constant.
This mapping is duplicated in at least two places within the SDK (
vault.pyanddaytona.pyper your comment on line 44 and the context snippets), which creates a maintenance burden. If a new provider is added or an existing mapping changes, all copies must be updated consistently.Since both files are in the same SDK package, consider extracting
_PROVIDER_ENV_VAR_MAPto a shared constants module (e.g.,agenta/sdk/constants/providers.py) and importing it in both locations.♻️ Example refactor to shared constant
Create
agenta/sdk/constants/providers.py:"""Shared provider-to-environment-variable mappings.""" PROVIDER_ENV_VAR_MAP = { "openai": "OPENAI_API_KEY", "cohere": "COHERE_API_KEY", # ... rest of mapping "together_ai": "TOGETHERAI_API_KEY", "gemini": "GEMINI_API_KEY", }Then in this file:
-_PROVIDER_ENV_VAR_MAP: Dict[str, str] = { - "openai": "OPENAI_API_KEY", - # ... -} +from agenta.sdk.constants.providers import PROVIDER_ENV_VAR_MAP as _PROVIDER_ENV_VAR_MAPApply the same import in
daytona.py.web/packages/agenta-playground/src/state/execution/executionRunner.ts (1)
714-742: 💤 Low valueConsider more defensive check for body-level error code.
Line 718 checks
bodyStatus.codefor truthiness before comparing to 200. While falsy error codes are rare in practice, the condition could miss edge cases likecode: 0.🛡️ Suggested defensive improvement
- if (bodyStatus && typeof bodyStatus === "object" && bodyStatus.code && bodyStatus.code !== 200) { + if (bodyStatus && typeof bodyStatus === "object" && bodyStatus.code !== undefined && bodyStatus.code !== null && bodyStatus.code !== 200) {api/oss/src/services/email_service.py (1)
47-47: ⚡ Quick winUse keyword-only parameters for new helpers and keyword dispatch calls.
The new helper signatures and dispatch calls are positional; this is brittle for same-typed parameters and less readable.
Suggested refactor
-def _send_via_smtp(to_email: str, subject: str, html_content: str, from_email: str) -> None: +def _send_via_smtp( + *, + # recipients + to_email: str, + from_email: str, + # content + subject: str, + html_content: str, +) -> None: ... -def _send_via_sendgrid(to_email: str, subject: str, html_content: str, from_email: str) -> None: +def _send_via_sendgrid( + *, + # recipients + to_email: str, + from_email: str, + # content + subject: str, + html_content: str, +) -> None: ... - _send_via_smtp(to_email, subject, html_content, from_email) + _send_via_smtp( + to_email=to_email, + from_email=from_email, + subject=subject, + html_content=html_content, + ) ... - _send_via_sendgrid(to_email, subject, html_content, from_email) + _send_via_sendgrid( + to_email=to_email, + from_email=from_email, + subject=subject, + html_content=html_content, + )As per coding guidelines, “Prefer keyword-only parameters using
*in function signatures” and “Use grouped sections in function signatures/calls with#separators for readability.”Also applies to: 74-74, 111-114
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0ba10a23-b942-4f39-a634-f94e8af871fe
📒 Files selected for processing (37)
api/ee/src/services/db_manager_ee.pyapi/ee/src/services/organization_service.pyapi/oss/src/services/email_service.pyapi/oss/src/services/organization_service.pyapi/oss/src/services/user_service.pyapi/oss/src/utils/env.pyapi/pyproject.tomldocs/docs/self-host/02-configuration.mdxhosting/docker-compose/ee/env.ee.dev.examplehosting/docker-compose/ee/env.ee.gh.examplehosting/docker-compose/oss/env.oss.dev.examplehosting/docker-compose/oss/env.oss.gh.examplesdks/python/agenta/sdk/middlewares/running/vault.pyweb/oss/src/components/EvalRunDetails/atoms/runInvocationAction.tsweb/oss/src/components/EvalRunDetails/components/Page.tsxweb/oss/src/components/EvalRunDetails/test.tsxweb/oss/src/components/EvaluationRunsTablePOC/actions/navigationActions.tsweb/oss/src/components/EvaluationRunsTablePOC/components/EvaluationRunsTable/index.tsxweb/oss/src/components/InfiniteVirtualTable/hooks/useTableManager.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/components/EvaluatorDetailsPopover.tsxweb/oss/src/components/SharedDrawers/TraceDrawer/hooks/useEvaluatorNavigation.tsweb/oss/src/components/TestcasesTableNew/components/TestcasesTableShell.tsxweb/oss/src/components/pages/observability/components/ObservabilityTable/index.tsxweb/oss/src/components/pages/observability/components/SessionsTable/index.tsxweb/oss/src/components/pages/prompts/PromptsPage.tsxweb/oss/src/components/pages/settings/WorkspaceManage/cellRenderers.tsxweb/oss/src/lib/helpers/buildBreadcrumbs.tsweb/oss/src/services/evaluations/invocations/api.tsweb/oss/src/services/profile/index.tsweb/packages/agenta-annotation-ui/src/components/AnnotationSession/ScenarioListView.tsxweb/packages/agenta-entities/src/runnable/types.tsweb/packages/agenta-entity-ui/src/shared/EntityTable.tsxweb/packages/agenta-playground/src/executeWorkflowRevision.tsweb/packages/agenta-playground/src/state/execution/executionRunner.tsweb/packages/agenta-playground/src/state/execution/types.tsweb/packages/agenta-ui/src/InfiniteVirtualTable/hooks/useEntityTableState.tsweb/packages/agenta-ui/src/InfiniteVirtualTable/hooks/useTableManager.tsx
💤 Files with no reviewable changes (3)
- api/pyproject.toml
- web/oss/src/components/EvaluationRunsTablePOC/actions/navigationActions.ts
- api/ee/src/services/db_manager_ee.py
| import sendgrid | ||
|
|
||
| _sg = sendgrid.SendGridAPIClient(api_key=env.sendgrid.api_key) | ||
| log.info("✓ Email enabled via SendGrid (legacy)") |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether sendgrid dependency is still declared in project manifests.
fd -a "pyproject.toml" | while read -r f; do
echo "==> $f"
rg -n "sendgrid" "$f" || true
doneRepository: Agenta-AI/agenta
Length of output: 321
🏁 Script executed:
#!/bin/bash
# 1) Find all occurrences of "sendgrid" and highlight likely dependency declarations.
rg -n --hidden --no-ignore-vcs --glob '!*node_modules/*' --glob '!*dist/*' \
"sendgrid" . \
|| true
# 2) Specifically search common dependency files.
for f in $(fd -a "requirements*.txt" . || true); do echo "==> $f"; rg -n "sendgrid" "$f" || true; done
for f in $(fd -a "poetry.lock" . || true); do echo "==> $f"; rg -n "sendgrid" "$f" || true; done
for f in $(fd -a "Pipfile.lock" . || true); do echo "==> $f"; rg -n "sendgrid" "$f" || true; done
for f in $(fd -a "setup.cfg" . || true); do echo "==> $f"; rg -n "sendgrid" "$f" || true; done
for f in $(fd -a "setup.py" . || true); do echo "==> $f"; rg -n "sendgrid" "$f" || true; doneRepository: Agenta-AI/agenta
Length of output: 12693
🏁 Script executed:
#!/bin/bash
# Read-only: confirm SendGrid package presence in dependency lockfile(s).
rg -n "sendgrid" api/uv.lock || trueRepository: Agenta-AI/agenta
Length of output: 760
🏁 Script executed:
rg -n "sendgrid" api/uv.lockRepository: Agenta-AI/agenta
Length of output: 760
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="api/oss/src/services/email_service.py"
echo "==> File head/tail context (lines 1-170)"
nl -ba "$FILE" | sed -n '1,170p'
echo
echo "==> Key searches"
rg -n "smtplib|SMTP\(|timeout=|_send_via_smtp|_send_via_sendgrid|def send_email|send_email\(|_send_via_sendgrid\(|_send_via_smtp\(" "$FILE"Repository: Agenta-AI/agenta
Length of output: 162
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="api/oss/src/services/email_service.py"
echo "==> File lines 1-200"
awk 'NR>=1 && NR<=200 {printf "%6d:%s\n", NR, $0}' "$FILE"
echo
echo "==> Search hits"
rg -n "smtplib|SMTP\(|timeout=|_send_via_smtp|_send_via_sendgrid|def send_email|send_email\(|def _send_via_smtp|def _send_via_sendgrid" "$FILE"Repository: Agenta-AI/agenta
Length of output: 4745
Fix email_service network robustness (SMTP timeout, async blocking, formatting) and make SendGrid import safer.
api/oss/src/services/email_service.py:_send_via_smtpcreatessmtplib.SMTP(smtp_host, smtp_port)without a timeout (lines 59 & 64); addtimeout=...to avoid hangs.send_emailisasyncbut calls_send_via_smtp/_send_via_sendgridsynchronously (lines 113–116), blocking the event loop; run the send in a thread (e.g.,asyncio.to_thread) or use async clients.- Keyword-only + grouped-call guideline:
_send_via_smtp,_send_via_sendgrid, andsend_emailuse positional parameters and positional calls (lines 45–47, 74–76, 89–91, 114–116); switch to*keyword-only params and format calls with#-grouped blocks. - Legacy SendGrid client is created at module import time (lines 20–23).
sendgridis present inapi/uv.lock(6.12.5), but defer import/client creation so enabling the config can’t break startup.
| server = smtplib.SMTP(smtp_host, smtp_port) | ||
| server.ehlo() | ||
| server.starttls() | ||
| server.ehlo() | ||
| else: | ||
| server = smtplib.SMTP(smtp_host, smtp_port) |
There was a problem hiding this comment.
Add an SMTP connection timeout to prevent request hangs.
api/oss/src/services/email_service.py creates smtplib.SMTP(smtp_host, smtp_port) in both branches without a timeout, so a stalled network connection can block indefinitely.
Suggested fix
- server = smtplib.SMTP(smtp_host, smtp_port)
+ server = smtplib.SMTP(smtp_host, smtp_port, timeout=10)
...
- server = smtplib.SMTP(smtp_host, smtp_port)
+ server = smtplib.SMTP(smtp_host, smtp_port, timeout=10)Also applies to: 67-69
| if _USE_SMTP: | ||
| _send_via_smtp(to_email, subject, html_content, from_email) | ||
| else: | ||
| _send_via_sendgrid(to_email, subject, html_content, from_email) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="api/oss/src/services/email_service.py"
echo "== File = $FILE =="
wc -l "$FILE"
echo
# show the relevant portion around lines 90-150 (covers 111-114)
nl -ba "$FILE" | sed -n '80,160p'
# show definitions/usages of the helper functions to see if they are sync and how they perform network I/O
echo
echo "== Look for _send_via_smtp definition =="
rg -n "def _send_via_smtp" "$FILE"
echo
nl -ba "$FILE" | sed -n '1,240p' | sed -n '1,240p' | head -n 40
echo
echo "== Look for _send_via_sendgrid definition =="
rg -n "def _send_via_sendgrid" "$FILE"
echo
# print near each helper definition block (best-effort: show 40 lines after match)
python3 - <<'PY'
import re, itertools
path="api/oss/src/services/email_service.py"
lines=open(path,'r',encoding='utf-8').read().splitlines()
# find line numbers for defs
for name in ["_send_via_smtp","_send_via_sendgrid","send_email"]:
for i,l in enumerate(lines, start=1):
if re.search(rf"def {re.escape(name)}\b", l):
start=max(1,i-10); end=min(len(lines), i+120)
print(f"\n== {name} around line {i} (show {start}-{end}) ==")
for j in range(start,end+1):
print(f"{j:4d}: {lines[j-1]}")
break
PY
# run ruff (non-destructive) in api folder per guidelines to see if there are existing issues related to this code
echo
echo "== ruff format/check in api/ (targeting oss tree only if available) =="
ls api
ruff --version || true
ruff format api/oss/src/services/email_service.py
ruff check api/oss/src/services/email_service.py --fixRepository: Agenta-AI/agenta
Length of output: 216
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="api/oss/src/services/email_service.py"
echo "== File = $FILE =="
wc -l "$FILE"
echo
# Line-numbered view of the relevant range (avoid `nl` which isn't available)
python3 - <<'PY'
path="api/oss/src/services/email_service.py"
start=80
end=160
with open(path,'r',encoding='utf-8') as f:
lines=f.readlines()
for i in range(start, min(end, len(lines))):
print(f"{i+1:4d}: {lines[i].rstrip()}")
PY
echo
echo "== Locate helper definitions =="
rg -n "def _send_via_smtp|def _send_via_sendgrid|async def send_email" "$FILE" || true
echo
echo "== Dump helper/send_email blocks (best-effort) =="
python3 - <<'PY'
import re
path="api/oss/src/services/email_service.py"
lines=open(path,'r',encoding='utf-8').read().splitlines()
def dump_at(name):
for idx,l in enumerate(lines, start=1):
if re.match(rf"\s*def {re.escape(name)}\b", l) or re.match(rf"\s*async def {re.escape(name)}\b", l):
start=max(1, idx-10); end=min(len(lines), idx+200)
print(f"\n== {name} starting at line {idx} (show {start}-{end}) ==")
for j in range(start,end+1):
print(f"{j:4d}: {lines[j-1]}")
return
print(f"\n== {name} not found ==")
for n in ["send_email","_send_via_smtp","_send_via_sendgrid"]:
dump_at(n)
PY
echo
echo "== Try ruff on this file (if ruff exists) =="
command -v ruff >/dev/null 2>&1 && ruff --version || echo "ruff not found in sandbox"
if command -v ruff >/dev/null 2>&1; then
ruff format "$FILE" || true
ruff check "$FILE" --fix || true
fiRepository: Agenta-AI/agenta
Length of output: 8421
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="api/oss/src/services/email_service.py"
python3 - <<'PY'
path="api/oss/src/services/email_service.py"
with open(path,'r',encoding='utf-8') as f:
lines=f.readlines()
for i,l in enumerate(lines[:80], start=1):
print(f"{i:4d}: {l.rstrip()}")
PYRepository: Agenta-AI/agenta
Length of output: 2839
Offload SMTP/SendGrid blocking calls from async send_email
send_email is async, but it calls synchronous SMTP/SendGrid network operations directly at lines 111-114 (smtplib.SMTP(...).sendmail(...) and _sg.send(...)), which can block the event loop under load.
Suggested fix
+import asyncio
...
- if _USE_SMTP:
- _send_via_smtp(to_email, subject, html_content, from_email)
- else:
- _send_via_sendgrid(to_email, subject, html_content, from_email)
+ if _USE_SMTP:
+ await asyncio.to_thread(
+ _send_via_smtp,
+ to_email=to_email,
+ subject=subject,
+ html_content=html_content,
+ from_email=from_email,
+ )
+ else:
+ await asyncio.to_thread(
+ _send_via_sendgrid,
+ to_email=to_email,
+ subject=subject,
+ html_content=html_content,
+ from_email=from_email,
+ )📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if _USE_SMTP: | |
| _send_via_smtp(to_email, subject, html_content, from_email) | |
| else: | |
| _send_via_sendgrid(to_email, subject, html_content, from_email) | |
| if _USE_SMTP: | |
| await asyncio.to_thread( | |
| _send_via_smtp, | |
| to_email=to_email, | |
| subject=subject, | |
| html_content=html_content, | |
| from_email=from_email, | |
| ) | |
| else: | |
| await asyncio.to_thread( | |
| _send_via_sendgrid, | |
| to_email=to_email, | |
| subject=subject, | |
| html_content=html_content, | |
| from_email=from_email, | |
| ) |
| 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.
Use shared truthy parsing for SMTP_USE_TLS for consistent behavior.
SMTP_USE_TLS=on|enabled|y|t is currently treated as false here, while other env booleans in this file accept those values via _TRUTHY.
Suggested 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📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 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 |
| export const resetPassword = async (userId: string): Promise<string> => { | ||
| const base = getBaseUrl() | ||
| const url = new URL("api/profile/reset-password", base) | ||
| url.searchParams.set("user_id", userId) | ||
| const data = await fetchJson<string>(url, { | ||
| method: "POST", | ||
| }) | ||
| return data |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate the generated request type and the corresponding client method.
rg -n -C3 'interface\s+ResetUserPasswordRequest|resetUserPassword|getAgentaSdkClient' web
# Show the generated request shape for this endpoint.
sed -n '1,120p' web/packages/agenta-api-client/src/generated/api/resources/users/client/requests/ResetUserPasswordRequest.tsRepository: Agenta-AI/agenta
Length of output: 14163
Route resetPassword through the Fern SDK client (no manual URL + fetchJson)
web/oss/src/services/profile/index.ts (lines 64–71) hardcodes api/profile/reset-password and builds user_id via URL.searchParams, bypassing the Fern-generated API boundary and duplicating the generated request contract (ResetUserPasswordRequest { user_id: string }). Replace the manual fetchJson call with the Fern client call (e.g., getAgentaSdkClient({host: getAgentaApiUrl()}).users.resetUserPassword({ user_id: userId })) so transport/typing stay in sync.
Source: Coding guidelines
6821d0f to
ad6e140
Compare
Summary
Fixes #4549 — breadcrumbs always showed "Auto Evals" for SDK evaluations instead of "SDK Evals".
Root cause
test.tsxnormalizedtype="custom"to"auto"before passing toEvalRunPreviewPage, discarding the SDK typePage.tsxtypeMaphad no"custom"entrybuildBreadcrumbs.tshardcoded"auto evaluation"as the fallback labelChanges
EvalRunDetails/test.tsxcustom → autonormalization; passtypethrough as-isEvalRunDetails/components/Page.tsxcustom: {label: "SDK Evals", kind: "custom"}totypeMap(matches tab label inEvaluationsView.tsx)lib/helpers/buildBreadcrumbs.ts"auto evaluation"to"Evaluations"Closes #4549