Skip to content

🤖 fix: actionable error messages for workspace identity generation failures#2401

Merged
ethanndickson merged 15 commits intomainfrom
workspace-identity-vdrg
Feb 16, 2026
Merged

🤖 fix: actionable error messages for workspace identity generation failures#2401
ethanndickson merged 15 commits intomainfrom
workspace-identity-vdrg

Conversation

@ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Feb 13, 2026

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 schemaNameGenerationErrorSchema with 8 categories: authentication, permission_denied, rate_limit, quota, service_unavailable, network, configuration, unknown. Each carries optional provider and raw fields for context.

Credential-modality-aware authentication — The authentication variant carries an authKind discriminator (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 classificationmapNameGenerationError() inspects AI SDK error types (APICallError status codes, RetryError unwrapping, TypeError for network failures). mapModelCreationError() maps SendMessageError from createModel() (e.g. api_key_not_foundauthentication + authKind: "api_key_missing", oauth_not_connectedauthentication + authKind: "oauth_not_connected"). Unknown errors now preserve error.raw verbatim instead of degrading to the string "unknown".

Frontend error flow — The useWorkspaceName hook now carries a discriminated WorkspaceNameUIError (generation | validation | transport) instead of a flat string. CreationControls renders a NameErrorDisplay component: validation/transport errors stay as simple red text; generation errors show a structured panel with title, message, fix hint, and optional docs link via formatNameGenerationError().

Storybook — 4 new stories under App/WorkspaceCreationErrors (PermissionDenied, RateLimited, AuthError, ValidationError) with a new nameGenerationResult mock ORPC option.

Validation

  • make static-check — pass
  • 32 backend mapper tests — pass
  • 12 formatter tests (including new OAuth + API-key-specific cases) — pass
  • 6 existing useCreationWorkspace tests — pass (no regression)

Risks

Low. The WorkspaceNameState.error type changed from string | null to WorkspaceNameUIError | 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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

@ethanndickson
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

- 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.
@ethanndickson ethanndickson added this pull request to the merge queue Feb 16, 2026
Merged via the queue into main with commit 5750a35 Feb 16, 2026
38 of 40 checks passed
@ethanndickson ethanndickson deleted the workspace-identity-vdrg branch February 16, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display more intuitive failure responses for workspace identity generation errors

1 participant

Comments