🤖 fix: actionable error messages for workspace identity generation failures#2401
🤖 fix: actionable error messages for workspace identity generation failures#2401ethanndickson wants to merge 9 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". |
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