🤖 fix: actionable error messages for workspace identity generation failures#2401
🤖 fix: actionable error messages for workspace identity generation failures#2401ethanndickson merged 15 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bcec4d8c48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48fce6a28a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8495f77b3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8495f77b3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47d6d16e52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: feb34d53fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
- Add dark: variants for error panel text colors so they're legible in both light and dark themes - Change permission_denied hint from "Verify your API key has the required permissions" to "Ensure your API key is valid"
Drop all red text classes — the red border + background is sufficient to convey the error. Use text-primary for title/message and text-secondary for the hint, which works well in both light and dark.
Collapse invalid_credentials into the same message as api_key_missing. Both now show "API key missing" with provider-specific guidance, keeping OAuth as the only distinct auth variant.
"No API key configured" doesn't make sense when the key exists but is rejected. Use wording that covers both cases.
Mux Gateway uses OAuth coupon codes, not API keys. When the coupon is missing, show "Mux Gateway not connected" with guidance to connect via Settings → Providers, instead of the generic API key error.
Summary
Replace raw, unhelpful error strings like "Name generation failed: Forbidden" with structured, actionable error messages when workspace identity generation fails. Users now see the cause (auth, rate limit, quota, etc.) plus a concrete fix hint and docs link.
Closes #1874
Background
When workspace name generation fails (e.g. invalid API key, 403, rate limit), the backend collapsed all errors into
{ type: "unknown", raw: "Name generation failed: Forbidden" }. The frontend displayed this raw string verbatim — giving users no clue what went wrong or how to fix it.Implementation
New typed error schema —
NameGenerationErrorSchemawith 8 categories:authentication,permission_denied,rate_limit,quota,service_unavailable,network,configuration,unknown. Each carries optionalproviderandrawfields for context.Credential-modality-aware authentication — The
authenticationvariant carries anauthKinddiscriminator (api_key_missing,oauth_not_connected,invalid_credentials) so the formatter can show the correct remediation: API-key guidance for missing keys, OAuth connection guidance for disconnected accounts, and generic credential guidance for 401 API errors.Backend classification —
mapNameGenerationError()inspects AI SDK error types (APICallErrorstatus codes,RetryErrorunwrapping,TypeErrorfor network failures).mapModelCreationError()mapsSendMessageErrorfromcreateModel()(e.g.api_key_not_found→authentication+authKind: "api_key_missing",oauth_not_connected→authentication+authKind: "oauth_not_connected"). Unknown errors now preserveerror.rawverbatim instead of degrading to the string"unknown".Frontend error flow — The
useWorkspaceNamehook now carries a discriminatedWorkspaceNameUIError(generation|validation|transport) instead of a flat string.CreationControlsrenders aNameErrorDisplaycomponent: validation/transport errors stay as simple red text; generation errors show a structured panel with title, message, fix hint, and optional docs link viaformatNameGenerationError().Storybook — 4 new stories under
App/WorkspaceCreationErrors(PermissionDenied, RateLimited, AuthError, ValidationError) with a newnameGenerationResultmock ORPC option.Validation
make static-check— passuseCreationWorkspacetests — pass (no regression)Risks
Low. The
WorkspaceNameState.errortype changed fromstring | nulltoWorkspaceNameUIError | null, but all consumers only use truthiness checks on it (for red border styling) — confirmed by searching all usages.Generated with
mux• Model:anthropic:claude-opus-4-6• Thinking:xhigh