Skip to content

fix(frontend): fix onboarding API key generation in SDK/tracing flows#3893

Open
mmabrouk wants to merge 1 commit intomainfrom
fix/api-key-onboarding
Open

fix(frontend): fix onboarding API key generation in SDK/tracing flows#3893
mmabrouk wants to merge 1 commit intomainfrom
fix/api-key-onboarding

Conversation

@mmabrouk
Copy link
Member

@mmabrouk mmabrouk commented Mar 3, 2026

Summary

  • Fix API key creation failures in onboarding SDK and tracing setup modals when workspace and project context are temporarily out of sync.
  • Resolve context via waitForWorkspaceContext and reconcile against project metadata before calling the keys API.
  • Prevent wrong-scope key creation by avoiding silent fallback to an unrelated project when a stale project id is detected.
  • Keep key creation gated on both workspace_id and project_id being available.

Validation

  • Ran corepack pnpm lint-fix in web/.
  • Performed subagent review focused on React/web best practices and AGENTS.md guidelines; addressed flagged risks before opening this PR.

What to QA

  • Onboarding -> Run evaluation from code -> click Generate API Key: key should be created successfully.
  • Onboarding -> Set up tracing modal -> click Generate API Key: key should be created successfully.
  • Settings -> API Keys page -> click Generate API Key: behavior remains unchanged.
  • Multi-workspace/project user: verify generated key belongs to the active project/workspace context.
  • Simulate stale context (e.g., quick workspace/project switching) and verify UI shows a clear refresh error instead of creating a key in the wrong scope.

Open with Devin

@vercel
Copy link

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Mar 3, 2026 0:36am

Request Review

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working Frontend labels Mar 3, 2026
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Railway Preview Environment

Preview URL https://gateway-production-e56e.up.railway.app/w
Project agenta-oss-pr-3893
Image tag pr-3893-4ca3268
Status Deployed

Updated at 2026-03-03T12:50:23.022Z

@junaway
Copy link
Contributor

junaway commented Mar 3, 2026

@ardaerzin ☝️ -- organizations, workspaces, projects temporarily out of sync (RE: earlier today)

@junaway junaway requested a review from ardaerzin March 3, 2026 12:50
Copy link
Contributor

@ardaerzin ardaerzin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Frontend size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants