Skip to content

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

Open
ethanndickson wants to merge 9 commits intomainfrom
workspace-identity-vdrg
Open

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

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